Sync upstream #727
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: Sync upstream | |
| on: | |
| schedule: | |
| - cron: '0 */6 * * *' | |
| workflow_dispatch: {} | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: .github/mirror | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| token: ${{ secrets.GH_PAT }} | |
| - name: Resolve Go version | |
| id: go-version | |
| run: echo "version=$(grep -oP '(?<=golang:)\S+' ../go/Dockerfile)" >> "$GITHUB_OUTPUT" | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ steps.go-version.outputs.version }} | |
| cache-dependency-path: .github/mirror/go.sum | |
| - run: go run . --output-dir "$GITHUB_WORKSPACE" | |
| env: | |
| UPSTREAM_REFRESH_TOKEN: ${{ secrets.UPSTREAM_REFRESH_TOKEN }} | |
| - name: Rotate refresh token | |
| if: always() | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_PAT }} | |
| REPO: ${{ github.repository }} | |
| TOKEN_FILE: ${{ github.workspace }}/.new-refresh-token | |
| run: | | |
| if [ -f "$TOKEN_FILE" ]; then | |
| gh secret set UPSTREAM_REFRESH_TOKEN --repo "$REPO" < "$TOKEN_FILE" | |
| echo "Refresh token rotated" | |
| fi | |
| - uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: 'sync: update community detections' |