Skip to content

Commit bbf2304

Browse files
[GitHub][workflows] Replace curl with sparse checkout (#78303)
1 parent 4a77414 commit bbf2304

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

.github/workflows/issue-subscriber.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ jobs:
1313
runs-on: ubuntu-latest
1414
if: github.repository == 'llvm/llvm-project'
1515
steps:
16+
- name: Checkout Automation Script
17+
uses: actions/checkout@v4
18+
with:
19+
sparse-checkout: llvm/utils/git/
20+
ref: main
21+
1622
- name: Setup Automation Script
23+
working-directory: ./llvm/utils/git/
1724
run: |
18-
curl -O -L --fail https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/"$GITHUB_SHA"/llvm/utils/git/github-automation.py
19-
curl -O -L --fail https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/"$GITHUB_SHA"/llvm/utils/git/requirements.txt
2025
chmod a+x github-automation.py
2126
pip install -r requirements.txt
2227
2328
- name: Update watchers
29+
working-directory: ./llvm/utils/git/
2430
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
2531
env:
2632
LABEL_NAME: ${{ github.event.label.name }}

.github/workflows/new-prs.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,20 @@ jobs:
3434
(github.event.pull_request.author_association != 'MEMBER') &&
3535
(github.event.pull_request.author_association != 'OWNER')
3636
steps:
37+
- name: Checkout Automation Script
38+
uses: actions/checkout@v4
39+
with:
40+
sparse-checkout: llvm/utils/git/
41+
ref: main
42+
3743
- name: Setup Automation Script
44+
working-directory: ./llvm/utils/git/
3845
run: |
39-
curl -O -L --fail https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/github-automation.py
40-
curl -O -L --fail https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/requirements.txt
4146
chmod a+x github-automation.py
4247
pip install -r requirements.txt
4348
4449
- name: Greet Author
50+
working-directory: ./llvm/utils/git/
4551
run: |
4652
./github-automation.py \
4753
--token '${{ secrets.GITHUB_TOKEN }}' \

.github/workflows/pr-subscriber.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ jobs:
1313
runs-on: ubuntu-latest
1414
if: github.repository == 'llvm/llvm-project'
1515
steps:
16+
- name: Checkout Automation Script
17+
uses: actions/checkout@v4
18+
with:
19+
sparse-checkout: llvm/utils/git/
20+
ref: main
21+
1622
- name: Setup Automation Script
23+
working-directory: ./llvm/utils/git/
1724
run: |
18-
curl -O -L --fail https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/github-automation.py
19-
curl -O -L --fail https://raw.githubusercontent.com/"$GITHUB_REPOSITORY"/main/llvm/utils/git/requirements.txt
2025
chmod a+x github-automation.py
2126
pip install -r requirements.txt
2227
2328
- name: Update watchers
29+
working-directory: ./llvm/utils/git/
2430
run: |
2531
./github-automation.py \
2632
--token '${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}' \

0 commit comments

Comments
 (0)