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: Guard Old Version Issues | |
| on: | |
| issues: | |
| types: [opened, edited] | |
| jobs: | |
| check-version: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const issue = context.payload.issue; | |
| if (issue.body.includes("Version: 1.8.1")) { | |
| // Add comment | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue.number, | |
| body: "This is a very old version of the Docker extension. Please update." | |
| }); | |
| // Close issue as not-planned | |
| await github.rest.issues.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: issue.number, | |
| state: "closed", | |
| state_reason: "not_planned" | |
| }); | |
| console.log(`Closed issue #${issue.number} as not-planned`); | |
| } |