diff --git a/.github/workflows/branch-cleanup.yml b/.github/workflows/branch-cleanup.yml deleted file mode 100644 index 2c5e8f3..0000000 --- a/.github/workflows/branch-cleanup.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Clean up feature branch - -on: - delete: - -permissions: - contents: read - packages: write - -jobs: - delete: - if: github.event.ref_type == 'branch' && github.event.ref != 'main' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Get tag from deleted branch - id: version-tag - run: echo "VERSION=$(echo "${{ github.event.ref }}" | sed -e 's,/,-,g')" >> "$GITHUB_OUTPUT" - - name: Debug - run: echo "Clean up Docker image ${{ vars.DOCKER_IMAGE_NAME }}:${{ steps.version-tag.outputs.VERSION }}" - - name: Delete image - if: ${{ steps.version-tag.outputs.VERSION }} - uses: bots-house/ghcr-delete-image-action@v1.1.0 - with: - owner: ${{ github.repository_owner }} - name: ${{ vars.DOCKER_IMAGE_NAME }} - token: ${{ secrets.GITHUB_TOKEN }} - tag: ${{ steps.version-tag.outputs.VERSION }} diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 58686d2..a4a12a5 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -16,7 +16,9 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Run tests uses: ./.github/actions/node-tests @@ -25,7 +27,9 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Run tests uses: ./.github/actions/python-tests @@ -34,7 +38,9 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Run tests uses: ./.github/actions/check-formatting @@ -48,12 +54,14 @@ jobs: packages: write contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Generate version tag id: version-tag - uses: nationalarchives/ds-docker-actions/.github/actions/get-version-tag@main + uses: nationalarchives/ds-docker-actions/.github/actions/get-version-tag@main # zizmor: ignore[unpinned-uses] Owned by The National Archives - name: Build Docker image - uses: nationalarchives/ds-docker-actions/.github/actions/build@main + uses: nationalarchives/ds-docker-actions/.github/actions/build@main # zizmor: ignore[unpinned-uses] Owned by The National Archives with: version: ${{ steps.version-tag.outputs.version-tag }} latest: ${{ github.ref == 'refs/heads/main' }} @@ -65,7 +73,7 @@ jobs: wiz-project-id: ${{ secrets.WIZ_PROJECT_DIGITALSERVICES }} - name: Create tag if: github.ref == 'refs/heads/main' - uses: actions/github-script@v5 + uses: actions/github-script@211cb3fefb35a799baa5156f9321bb774fe56294 # v5.2.0 with: script: | github.rest.git.createRef({ diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 534e24c..f41db2e 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -27,9 +27,11 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: 3.12 - name: Install dependencies @@ -39,11 +41,11 @@ jobs: - name: Build run: mkdocs build - name: Setup Pages - uses: actions/configure-pages@v4 + uses: actions/configure-pages@1f0c5cde4bc74cd7e1254d0cb4de8d49e9068c7d # v4.0.0 - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 with: path: site - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 + uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4c73198..ad21328 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -13,20 +13,26 @@ jobs: test-node: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Run tests uses: ./.github/actions/node-tests test-python: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Run tests uses: ./.github/actions/python-tests check-formatting: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Run tests uses: ./.github/actions/check-formatting