Skip to content

Commit 537afaa

Browse files
authored
Merge pull request #165 from artichoke/terraform/update-file-.github-workflows-code-coverage.yaml
chore: Update `.github/workflows/code-coverage.yaml` in `artichoke/st…
2 parents 09ec460 + 5e6f29a commit 537afaa

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.github/workflows/code-coverage.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ jobs:
2121
steps:
2222
- name: Checkout repository
2323
uses: actions/[email protected]
24+
with:
25+
persist-credentials: false
2426

2527
- name: Install nightly Rust toolchain
2628
uses: artichoke/setup-rust/[email protected]
@@ -61,7 +63,7 @@ jobs:
6163
run: grcov strftime-ruby*.profraw --source-dir . --keep-only 'src/**/*.rs' --binary-path target/debug -t covdir --filter covered -o target/coverage/coverage.json
6264

6365
- name: Configure AWS Credentials
64-
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
66+
uses: aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
6567
if: github.ref == 'refs/heads/trunk'
6668
with:
6769
aws-region: us-west-2
@@ -82,8 +84,13 @@ jobs:
8284
8385
- name: Check missed lines
8486
shell: python
87+
env:
88+
GITHUB_REF_NAME: ${{ github.ref_name }}
89+
GITHUB_EVENT_NAME: ${{ github.event_name }}
90+
GITHUB_EVENT_NUMBER: ${{ github.event.number }}
8591
run: |
8692
import json
93+
import os
8794
from urllib.request import urlopen
8895
8996
trunk_coverage_url = "https://codecov.artichokeruby.org/strftime-ruby/coverage.json"
@@ -101,7 +108,7 @@ jobs:
101108
print("")
102109
103110
104-
if "${{ github.ref_name }}" == "trunk":
111+
if os.environ.get("GITHUB_REF_NAME") == "trunk":
105112
# We don't need to compare trunk coverage to itself
106113
exit(0)
107114
@@ -114,8 +121,8 @@ jobs:
114121
branch_coverage = json.load(local)
115122
116123
on = None
117-
if "${{ github.event_name }}" == "pull_request":
118-
on = "PR artichoke/strftime-ruby#${{ github.event.number }}"
124+
if os.environ.get("GITHUB_EVENT_NAME") == "pull_request":
125+
on = "PR artichoke/strftime-ruby#" + os.environ.get("GITHUB_EVENT_NUMBER")
119126
120127
print_report(branch_coverage, on=on)
121128

0 commit comments

Comments
 (0)