Harden CI workflows (#1745) #202
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: cherry-pick | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Generate LGTM App token | |
| id: lgtm-app-token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| with: | |
| client-id: ${{ secrets.LGTM_APP_CLIENT_ID }} | |
| private-key: ${{ secrets.LGTM_APP_PRIVATE_KEY }} | |
| owner: ${{ github.repository_owner }} | |
| permission-contents: write | |
| permission-pull-requests: write | |
| - name: Prepare git | |
| env: | |
| GITHUB_USER: 1gtm | |
| GITHUB_TOKEN: ${{ steps.lgtm-app-token.outputs.token }} | |
| run: | | |
| git config --global user.name "${GITHUB_USER}" | |
| git config --global user.email "${GITHUB_USER}@appscode.com" | |
| git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
| - name: Update release branches | |
| env: | |
| GITHUB_TOKEN: ${{ steps.lgtm-app-token.outputs.token }} | |
| run: | | |
| ./hack/scripts/cherry-pick.sh |