fix(actions): use a specific shortening length for SHAs (#3929)

* fix(actions): use a specific shortening length for SHAs

The rlespinasse/github-slug-action now works without checking out the code, reduce time and improving security with following actions.

This requires to specify the GITHUB_SHA_SHORT variable length, as git uses 8 by default, but docker uses 7 by default.

* fix(actions): target correct rlespinasse/github-slug-action version

* fix(actions): just use major version

* fix(actions): github-slug-action is not being correctly referenced
This commit is contained in:
Gustavo Valverde 2022-03-21 19:07:01 -04:00 committed by GitHub
parent 2b51f9098d
commit 39765534f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 36 deletions

View File

@ -38,6 +38,8 @@ jobs:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
# Automatic tag management and OCI Image Format Specification for labels
- name: Docker meta
@ -129,12 +131,10 @@ jobs:
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
steps:
- uses: actions/checkout@v3.0.0
with:
persist-credentials: false
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
# Setup gcloud CLI
- name: Authenticate to Google Cloud
@ -195,12 +195,10 @@ jobs:
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v3.0.0
with:
persist-credentials: false
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
# Setup gcloud CLI
- name: Authenticate to Google Cloud

View File

@ -21,12 +21,10 @@ jobs:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v2.4.0
with:
persist-credentials: false
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
# Setup gcloud CLI
- name: Authenticate to Google Cloud

View File

@ -55,6 +55,8 @@ jobs:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
# Automatic tag management and OCI Image Format Specification for labels
- name: Docker meta
@ -135,12 +137,10 @@ jobs:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v3.0.0
with:
persist-credentials: false
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
# Setup gcloud CLI
- name: Authenticate to Google Cloud

View File

@ -56,6 +56,8 @@ jobs:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
# Automatic tag management and OCI Image Format Specification for labels
- name: Docker meta
@ -134,12 +136,10 @@ jobs:
needs: build
if: ${{ github.event.inputs.regenerate-disks != 'true' }}
steps:
- uses: actions/checkout@v3.0.0
with:
persist-credentials: false
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
- name: Run all zebrad tests
run: |
@ -157,12 +157,10 @@ jobs:
needs: build
if: ${{ github.event.inputs.regenerate-disks != 'true' }}
steps:
- uses: actions/checkout@v3.0.0
with:
persist-credentials: false
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
- name: Run tests with fake activation heights
run: |
@ -178,12 +176,10 @@ jobs:
needs: build
if: ${{ github.event.inputs.regenerate-disks != 'true' }}
steps:
- uses: actions/checkout@v3.0.0
with:
persist-credentials: false
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
- name: Run zebrad large sync tests
run: |
@ -196,12 +192,10 @@ jobs:
needs: build
if: ${{ github.event.inputs.regenerate-disks != 'true' }}
steps:
- uses: actions/checkout@v3.0.0
with:
persist-credentials: false
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
- name: Run tests with included lightwalletd binary
run: |
@ -248,6 +242,8 @@ jobs:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
- name: Downcase network name for disks
run: |
@ -364,12 +360,10 @@ jobs:
contents: 'read'
id-token: 'write'
steps:
- uses: actions/checkout@v3.0.0
with:
persist-credentials: false
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
- name: Downcase network name for disks
run: |

View File

@ -48,6 +48,8 @@ jobs:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
# Automatic tag management and OCI Image Format Specification for labels
- name: Docker meta

View File

@ -38,6 +38,8 @@ jobs:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
# Automatic tag management and OCI Image Format Specification for labels
- name: Docker meta

View File

@ -30,6 +30,8 @@ jobs:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
with:
short-length: 7
# Setup gcloud CLI
- name: Authenticate to Google Cloud