Skip to content

Commit

Permalink
Use actions/checkout properly in update-main.yml and update-main-sour…
Browse files Browse the repository at this point in the history
…ce.yml
  • Loading branch information
adamkpickering committed Apr 18, 2024
1 parent 300c366 commit 3a1cf41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/update-main-source.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ on:
jobs:
update:
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:

- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
Expand Down Expand Up @@ -45,4 +43,3 @@ jobs:
git diff --quiet origin/main-source main-source && exit 0
git push origin main-source
# git remote set-url origin https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/rancher/partner-charts
15 changes: 7 additions & 8 deletions .github/workflows/update-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ jobs:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
Expand All @@ -23,8 +21,8 @@ jobs:
uses: rancher-eio/read-vault-secrets@main
with:
secrets: |
github/repo/rancher/partner-charts/github/app-credentials appId | APP_ID ;
github/repo/rancher/partner-charts/github/app-credentials privateKey | PRIVATE_KEY
secret/data/github/repo/rancher/partner-charts/github/app-credentials appId | APP_ID ;
secret/data/github/repo/rancher/partner-charts/github/app-credentials privateKey | PRIVATE_KEY
- name: Generate short-lived github app token
uses: actions/create-github-app-token@v1
Expand All @@ -33,9 +31,11 @@ jobs:
app-id: ${{ env.APP_ID }}
private-key: ${{ env.PRIVATE_KEY }}

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

- name: Update main branch with latest from main-source
env:
APP_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
# checkout action only fetches main-source, so we need to fetch main
git fetch origin main --depth 1
Expand All @@ -48,5 +48,4 @@ jobs:
git diff-index --quiet HEAD assets index.yaml && exit 0
git commit -m "Release partner charts"
git remote set-url origin https://x-access-token:${APP_TOKEN}@github.com/rancher/partner-charts
git push origin
git push origin main

0 comments on commit 3a1cf41

Please sign in to comment.