Skip to content

Commit 43f1f09

Browse files
authored
Merge pull request #1439 from freedomofpress/ada/gha-nightlies-privs-test
Update nightlies GHA workflow to use more narrowly-scoped GH app
2 parents 56237e7 + 026895f commit 43f1f09

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/nightlies.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,27 +49,38 @@ jobs:
4949
- name: Install dependencies
5050
run: |
5151
apt-get update && apt-get install --yes git git-lfs
52+
5253
- uses: actions/download-artifact@v4
5354
with:
5455
pattern: "*"
56+
5557
- uses: actions/checkout@v5
5658
with:
5759
repository: "freedomofpress/securedrop-yum-test"
5860
path: "securedrop-yum-test"
5961
lfs: true
60-
token: ${{ secrets.PUSH_TOKEN }}
61-
# We need to store credentials here
62-
persist-credentials: true
62+
persist-credentials: false
63+
64+
- uses: actions/create-github-app-token@v2
65+
id: app-token
66+
with:
67+
app-id: ${{ vars.FPF_BRANCH_UPDATER_APP_ID }}
68+
private-key: ${{ secrets.FPF_BRANCH_UPDATER_APP_PRIVKEY }}
69+
repositories: securedrop-yum-test
70+
6371
- name: Commit and push
72+
env:
73+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
74+
TARGET_REPO: freedomofpress/securedrop-yum-test
6475
run: |
6576
git config --global user.email "securedrop@freedom.press"
66-
git config --global user.name "sdcibot"
77+
git config --global user.name "sdcibot-nightlies[bot]"
6778
cd securedrop-yum-test
6879
mkdir -p workstation/dom0/f37-nightlies
6980
cp -v ../rpm-build/*.rpm workstation/dom0/f37-nightlies/
7081
git add .
7182
git diff-index --quiet HEAD || git commit -m "Automated SecureDrop workstation build"
72-
git push origin main
83+
git push https://x-access-token:${GH_TOKEN}@github.com/${TARGET_REPO}.git main
7384
7485
openqa-nightly:
7586
uses: ./.github/workflows/openqa.yml

0 commit comments

Comments
 (0)