Skip to content

Commit

Permalink
Fix PR not triggering CI (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomleb authored Dec 16, 2024
1 parent 5c0d8d0 commit 51d8757
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/sync-deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,29 @@ jobs:
name: Sync dependencies
runs-on: ubuntu-latest
steps:
- uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
secret/data/github/repo/${{ github.repository }}/github/app-credentials appId | APP_ID ;
secret/data/github/repo/${{ github.repository }}/github/app-credentials privateKey | PRIVATE_KEY
# Fetch github token just for the webhook repository
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}
repositories: |
webhook
- name : Checkout webhook repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: "${{ env.WEBHOOK_REF }}"
path: webhook
token: ${{ steps.app-token.outputs.token }}
# Allow making git push request later on
persist-credentials: true

- name : Checkout rancher repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand All @@ -44,8 +62,12 @@ jobs:
- name: Configure the committer
run: |
cd webhook
git config --global user.name "Webhook Sync Bot"
git config --global user.email "webhooksyncbot@users.noreply.github.com"
user_id=$(gh api "/users/$APP_USER" --jq .id)"
git config --global user.name "$APP_USER"
git config --global user.email "${user_id}+${APP_USER}@users.noreply.github.com>"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
APP_USER: "${{ steps.app-token.outputs.app-slug }}[bot]"

- name: Run sync-deps script
run: |
Expand Down Expand Up @@ -82,4 +104,4 @@ jobs:
--head "${{ github.repository_owner }}:$BRANCH" \
--base "$WEBHOOK_REF"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ steps.app-token.outputs.token }}

0 comments on commit 51d8757

Please sign in to comment.