fix: update devcontainer template structure #752
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 | |
| on: | |
| pull_request: | |
| schedule: | |
| - cron: "30 2 * * 0" | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| update-apt-dependencies: | |
| name: ${{ github.event_name == 'pull_request' && '🧪' || '' }} OS (🍨 ${{ matrix.flavor }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| flavor: ["base", "cpp", "rust"] | |
| # Using our own container is required since we need all package sources | |
| # set-up correctly. | |
| container: ghcr.io/philips-software/amp-devcontainer-${{ matrix.flavor }}:edge | |
| permissions: | |
| contents: write # is needed by peter-evans/create-pull-request to create branches and push commits | |
| pull-requests: write # is needed by peter-evans/create-pull-request to create a PR | |
| steps: | |
| - uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/update-apt-packages | |
| id: update-packages | |
| with: | |
| input-file: .devcontainer/${{ matrix.flavor }}/apt-requirements*.json | |
| - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | |
| id: token | |
| if: github.event_name != 'pull_request' | |
| with: | |
| app-id: ${{ vars.FOREST_RELEASER_APP_ID }} | |
| private-key: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY }} | |
| - uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| commit-message: "Update ${{ join(fromJson(steps.update-packages.outputs.updated-dependencies), ', ') }}" | |
| branch: feature/amp-devcontainer-${{ matrix.flavor }}/update-apt-packages | |
| title: "chore(deps, ${{ matrix.flavor }}): update ${{ join(fromJson(steps.update-packages.outputs.updated-dependencies), ', ') }}" | |
| labels: dependencies,apt | |
| token: ${{ steps.token.outputs.token }} | |
| sign-commits: true | |
| update-vscode-extensions: | |
| name: ${{ github.event_name == 'pull_request' && '🧪' || '' }} Extensions (🍨 ${{ matrix.flavor }}, ${{ matrix.file }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| flavor: ["cpp", "rust"] | |
| file: ["devcontainer-metadata.json", "devcontainer.json"] | |
| permissions: | |
| contents: write # is needed by peter-evans/create-pull-request to create branches and push commits | |
| pull-requests: write # is needed by peter-evans/create-pull-request to create a PR | |
| steps: | |
| - uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - uses: ./.github/actions/update-vscode-extensions | |
| id: update-extensions | |
| with: | |
| input-file: .devcontainer/${{ matrix.flavor }}/${{ matrix.file }} | |
| - name: Generate PR body | |
| run: | | |
| { | |
| echo "> [!NOTE]" | |
| echo "> Before merging this PR, please conduct a manual test checking basic functionality of the updated plug-ins. There are limited automated tests for the VS Code Extension updates." | |
| echo "" | |
| cat "$MARKDOWN_SUMMARY_FILE" | |
| } >> "${RUNNER_TEMP}/pull-request-body.md" | |
| env: | |
| MARKDOWN_SUMMARY_FILE: ${{ steps.update-extensions.outputs.markdown-summary-file }} | |
| - uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1 | |
| id: token | |
| if: github.event_name != 'pull_request' | |
| with: | |
| app-id: ${{ vars.FOREST_RELEASER_APP_ID }} | |
| private-key: ${{ secrets.FOREST_RELEASER_APP_PRIVATE_KEY }} | |
| - uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0 | |
| if: github.event_name != 'pull_request' | |
| with: | |
| commit-message: "Update ${{ join(fromJson(steps.update-extensions.outputs.updated-dependencies), ', ') }} in ${{ matrix.file }}" | |
| branch: feature/amp-devcontainer-${{ matrix.flavor }}/update-vscode-extensions-${{ matrix.file }} | |
| body-path: ${{ runner.temp }}/pull-request-body.md | |
| title: "chore(deps, ${{ matrix.flavor }}): update ${{ join(fromJson(steps.update-extensions.outputs.updated-dependencies), ', ') }} in ${{ matrix.file }}" | |
| labels: dependencies,vscode-extensions | |
| token: ${{ steps.token.outputs.token }} | |
| sign-commits: true |