Skip to content

Commit

Permalink
fixing permissions for new token strategy from EIO
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasSUSE committed Jan 22, 2025
1 parent 802727f commit da83759
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/regsync-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,37 @@ jobs:
needs: onLabelAndApproval
if: needs.onLabelAndApproval.outputs.is_approved == 'true'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Read App Secrets
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
- name: Create App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PUSH_TOKEN }}
token: ${{ steps.app-token.outputs.token }}

- name: Set-up Ruby 3.2
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2' # Not needed with a .ruby-version file

- name: Generate RegSync
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
echo ${{ secrets.PUSH_TOKEN }} | gh auth login --with-token
gh pr checkout ${{ github.event.pull_request.number }}
git config --global user.email "${{ secrets.USER_GITHUB }}"
git config --global user.name "rancherbot"
Expand Down

0 comments on commit da83759

Please sign in to comment.