Skip to content

Commit

Permalink
Reference actions by commit SHA (#224)
Browse files Browse the repository at this point in the history
* Ref actions by commit SHA in codeql-analysis.yml

It's important to make sure the SHA's are from the original repositories and not forks.

For reference:

https://github.com/actions/cache/releases/tag/v3.3.1
actions/cache@88522ab

https://github.com/actions/checkout/releases/tag/v3.5.2
actions/checkout@8e5e7e5

https://github.com/github/codeql-action/releases/tag/v2.3.6
https://github.com/github/codeql-action/commit/83f0fe6c4988d98a455712a27f0255212bba9bd4 

Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>

* Ref actions by commit SHA in coverage.yml

It's important to make sure the SHA's are from the original repositories and not forks.

For reference:

https://github.com/actions/cache/releases/tag/v3.3.1
actions/cache@88522ab

https://github.com/actions/checkout/releases/tag/v3.5.2
actions/checkout@8e5e7e5

https://github.com/actions/setup-java/releases/tag/v3.11.0
https://github.com/actions/setup-java/commit/5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2

https://github.com/codecov/codecov-action/releases/tag/v3.1.4
codecov/codecov-action@eaaf4be


Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>

* Ref actions by commit SHA in maven.yml

It's important to make sure the SHA's are from the original repositories and not forks.

For reference:

https://github.com/actions/cache/releases/tag/v3.3.1
actions/cache@88522ab

https://github.com/actions/checkout/releases/tag/v3.5.2
actions/checkout@8e5e7e5

https://github.com/actions/setup-java/releases/tag/v3.11.0
https://github.com/actions/setup-java/commit/5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2

Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>

* Ref actions by commit SHA in scorecards-analysis.yml

It's important to make sure the SHA's are from the original repositories and not forks.

For reference:

https://github.com/actions/checkout/releases/tag/v3.5.2
actions/checkout@8e5e7e5


Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>

---------

Signed-off-by: Gabriela Gutierrez <gabigutierrez@google.com>
  • Loading branch information
gabibguti committed Jun 3, 2023
1 parent 8b012a7 commit f1229a3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3.5.2
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
persist-credentials: false
- uses: actions/cache@v3.3.1
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
Expand All @@ -57,7 +57,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -68,7 +68,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -82,4 +82,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@83f0fe6c4988d98a455712a27f0255212bba9bd4 # v2.3.6
8 changes: 4 additions & 4 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ jobs:
java: [ 8, 11 ]

steps:
- uses: actions/checkout@v3.5.2
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
persist-credentials: false
- uses: actions/cache@v3.3.1
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Build with Maven
run: mvn -V install jacoco:report -DdataFile=jacoco_jdk${{ matrix.java }}.exec --file pom.xml --no-transfer-progress

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
files: ./target/site/jacoco/jacoco.xml
6 changes: 3 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ jobs:
steps:
- name: Prepare git
run: git config --global core.autocrlf false
- uses: actions/checkout@v3.5.2
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
persist-credentials: false
- uses: actions/cache@v3.3.1
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3.11.0
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecards-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
steps:

- name: "Checkout code"
uses: actions/checkout@v3.5.2 # 3.1.0
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
persist-credentials: false

Expand Down

0 comments on commit f1229a3

Please sign in to comment.