Skip to content

Commit

Permalink
ci: Added GH_ACCESS_TOKEN and appropriate git credentials (#1101)
Browse files Browse the repository at this point in the history
Signed-off-by: Roger Barker <[email protected]>
  • Loading branch information
rbarkerSL authored Jan 16, 2025
1 parent 888f95a commit 4f0d0cf
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/update-draft-hips.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,25 @@ on:
jobs:
update-draft-hips:
if: github.ref == 'refs/heads/main' # Only run on main branch
runs-on: ubuntu-latest
runs-on: improvement-proposals-linux-medium
permissions:
contents: write
pull-requests: read
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Checkout Code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
token: ${{ secrets.GH_ACCESS_TOKEN }}

- name: Import GPG Key
id: gpg_importer
uses: step-security/ghaction-import-gpg@6c8fe4d0126a59d57c21f87c9ae5dd3451fa3cca # v6.1.0
with:
git_commit_gpgsign: true
git_tag_gpgsign: true
git_user_signingkey: true
gpg_private_key: ${{ secrets.GPG_KEY_CONTENTS }}
passphrase: ${{ secrets.GPG_KEY_PASSPHRASE }}

- name: Setup Node.js
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
Expand Down Expand Up @@ -107,12 +120,15 @@ jobs:
- name: Run Script
run: node fetch-draft-hips.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}

- name: Commit and Push Changes
env:
GITHUB_USER_EMAIL: ${{ secrets.GIT_USER_EMAIL }}
GITHUB_USER_NAME: ${{ secrets.GIT_USER_NAME }}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git config --local user.email "$GITHUB_USER_EMAIL"
git config --local user.name "$GITHUB_USER_NAME"
git add _data/draft_hips.json
git commit -m "Update draft HIPs data [skip ci]" || echo "No changes to commit"
git commit -s -S -m "Update draft HIPs data [skip ci]" || echo "No changes to commit"
git push origin main || echo "No changes to push"

0 comments on commit 4f0d0cf

Please sign in to comment.