TrackingIssue #3346
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: TrackingIssue | |
| # This workflow generates a "tracking" issue when a PR is found targeting main and isn't already tracked. | |
| on: | |
| schedule: | |
| - cron: '0 */4 * * *' # Every 4 hours | |
| workflow_dispatch: {} # Allows manual triggering | |
| env : | |
| TERRAFORM_MAINTAINERS: ${{ vars.TERRAFORM_MAINTAINERS }} # eg. ["matttrach"] | |
| permissions: {} | |
| jobs: | |
| generate-issue: | |
| name: 'Create Tracking Issue' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| issues: write # To create issues and add labels | |
| pull-requests: read # To read PRs | |
| contents: read # To checkout the repo and get branch names | |
| steps: | |
| - name: Checkout Code | |
| id: checkout-code | |
| # https://github.com/actions/checkout/releases | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| ref: 'main' | |
| - name: Create Tracking Issue | |
| id: create-tracking-issue | |
| # https://github.com/actions/github-script/releases | |
| uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 | |
| env: | |
| TERRAFORM_MAINTAINERS: ${{ env.TERRAFORM_MAINTAINERS }} | |
| SCRIPT_MODE: tracking-issue | |
| with: | |
| script: | | |
| const scriptPath = `${process.env.GITHUB_WORKSPACE}/.github/workflows/scripts/releases.js`; | |
| const { default: script } = await import(scriptPath); | |
| await script({github, context, core, process}); |