-
Notifications
You must be signed in to change notification settings - Fork 1.2k
59 lines (57 loc) · 2.28 KB
/
update-reproducibles.yml
File metadata and controls
59 lines (57 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Update reproducible requirements
on:
pull_request:
branches: [develop]
paths:
# run this GHA if the following files have changed
- pyproject.toml
- requirements/reproducible-linux.txt
- requirements/reproducible-mac.txt
- requirements/reproducible-win.txt
jobs:
# For PRs from within the aws/aws-sam-cli repo: auto-update and push
update-reqs:
permissions:
pull-requests: write
contents: write
if: github.repository_owner == 'aws' && github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
- name: Update all reproducible requirements
run: make update-reproducible-reqs-uv
- name: Push changes
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git add requirements/reproducible-*.txt
git commit -m "Update reproducible requirements" || echo "nothing to commit"
git push
# For PRs from forks: verify requirements are up to date, fail with instructions if not
verify-up-to-date:
if: github.repository_owner == 'aws' && github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
- name: Check reproducible requirements are up to date
run: make update-reproducible-reqs-uv
- name: Fail if requirements are out of date
run: |
if ! git diff --quiet requirements/reproducible-*.txt; then
echo "::error::Reproducible requirements are out of date. Please run 'make update-reproducible-reqs' locally and commit the changes before raising a PR."
exit 1
fi
echo "Reproducible requirements are up to date."