Check features #11
This file contains 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: Check features | |
permissions: | |
issues: write | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '34 4 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'pnpm' | |
- run: pnpm install --no-frozen-lockfile | |
- run: pnpm run script:check-features | |
id: check-features | |
- name: Details | |
env: | |
MISSING: ${{steps.check-features.outputs.missing}} | |
TEXT: ${{steps.check-features.outputs.text}} | |
run: echo "missing $MISSING TEXT $TEXT" | |
- name: Create or update issue | |
if: steps.check-features.outputs.missing > 0 | |
uses: JasonEtco/create-an-issue@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TEXT: ${{steps.check-features.outputs.text}} | |
with: | |
filename: .github/ISSUE_TEMPLATE_ACTION.md | |
update_existing: true | |
search_existing: open | |
- name: Close issue | |
if: steps.check-features.outputs.missing == 0 | |
run: gh issue list --json number,title --jq '.[] | select(.title == "@batijs/core update detected") | .number' | xargs gh issue close |