Restrict permissions, update actions

The actions release numbers were taken from the 3.1dev branch.

    Note: there was one strange codespell error in PR #2263.
    Maybe the updated action will avoid this in the future.
This commit is contained in:
Dirk Wetter 2022-11-10 10:35:43 +01:00
parent abdd51d815
commit b8afca6be1
3 changed files with 19 additions and 12 deletions

View File

@ -1,12 +1,15 @@
--- ---
name: Codespell name: Codespell
on: [push, pull_request] on: [push, pull_request]
permissions:
contents: read
jobs: jobs:
codespell: codespell:
name: Check for spelling errors name: Check for spelling errors
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- uses: codespell-project/actions-codespell@master - uses: codespell-project/actions-codespell@master
with: with:
skip: ca_hashes.txt,tls_data.txt,*.pem,OPENSSL-LICENSE.txt skip: ca_hashes.txt,tls_data.txt,*.pem,OPENSSL-LICENSE.txt

View File

@ -2,7 +2,7 @@ name: docker-3.0
on: on:
push: push:
branches: branches:
- 3.0 - 3.0
workflow_dispatch: workflow_dispatch:
schedule: schedule:
@ -19,36 +19,36 @@ jobs:
steps: steps:
- name: Source checkout - name: Source checkout
uses: actions/checkout@v2.3.4 uses: actions/checkout@v3
- name: Setup QEMU - name: Setup QEMU
id: qemu id: qemu
uses: docker/setup-qemu-action@v1.2.0 uses: docker/setup-qemu-action@v2.1.0
- name: Setup Buildx - name: Setup Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2
- name: Set Docker metadata - name: Set Docker metadata
id: docker_meta id: docker_meta
uses: docker/metadata-action@v3 uses: docker/metadata-action@v4
with: with:
images: ${{ github.repository }} images: ${{ github.repository }}
labels: | labels: |
org.opencontainers.image.version=${{ env.BUILD_VERSION }} org.opencontainers.image.version=${{ env.BUILD_VERSION }}
org.opencontainers.image.revision=${{ github.sha }} org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.title=${{ github.repository }} org.opencontainers.image.title=${{ github.repository }}
- name: GitHub login - name: GitHub login
if: ${{ github.event_name != 'pull_request' }} if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v1.10.0 uses: docker/login-action@v2.1.0
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2.6.1 uses: docker/build-push-action@v3.2.0
with: with:
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}
context: . context: .
@ -60,3 +60,4 @@ jobs:
labels: ${{ steps.docker_meta.outputs.labels }} labels: ${{ steps.docker_meta.outputs.labels }}
tags: | tags: |
ghcr.io/${{ github.repository }}:${{ env.BUILD_VERSION }} ghcr.io/${{ github.repository }}:${{ env.BUILD_VERSION }}
ghcr.io/${{ github.repository }}:latest

View File

@ -23,6 +23,9 @@ on:
- 'LICENSE' - 'LICENSE'
- 'Dockerfile' - 'Dockerfile'
permissions:
contents: read
jobs: jobs:
build: build:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
@ -32,7 +35,7 @@ jobs:
perl: ['5.26'] perl: ['5.26']
name: Perl ${{ matrix.perl }} on ${{ matrix.os }} name: Perl ${{ matrix.perl }} on ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v3
- name: Set up perl - name: Set up perl
uses: shogo82148/actions-setup-perl@v1 uses: shogo82148/actions-setup-perl@v1
with: with: