Upgrade Defang GitHub Action to version 2 #5
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: Update Template Workflows | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "templates/defang.yaml" | |
| workflow_dispatch: | |
| jobs: | |
| update_workflows: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - name: Install dependencies | |
| run: npm ci | |
| working-directory: scripts | |
| - name: Update Template Workflows | |
| uses: actions/github-script@v7 | |
| env: | |
| PUSH_TOKEN: ${{ secrets.TEMPLATES_MANAGER_TOKEN }} | |
| with: | |
| github-token: ${{ secrets.TEMPLATES_MANAGER_TOKEN }} | |
| script: | | |
| const script = require('./scripts/update-template-workflows.js') | |
| await script({github, context, core}); |