Skip to content

Commit fd86e95

Browse files
committed
feat: restrict actions that use secrets to docker/docker-credential-helpers
This change adds conditional expressions to restrict the execution of pipeline steps that consume secrets, such as uploading artifacts to remote stores, from being executed unless they are being executed in the context of the upstream `docker/docker-credential-helpers` repository. With this change, downstream, external contributors (users who have forked this repository, and have that fork on GitHub) can enable GitHub Actions in their fork, in order to iterate and validate their changes without waiting on the upstream maintainers. This is extremely helpful to all contributors, because the repository requires maintainer approval in order to execute pipelines, which is burdensome on the maintainers, and due to this restrictive gatekeeping, contributors have an excessively long feedback loop. Signed-off-by: sudoforge <[email protected]>
1 parent 6b9df3e commit fd86e95

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108
-
109109
name: Upload coverage
110110
uses: codecov/codecov-action@v4
111+
if: github.repository == 'docker/docker-credential-helpers'
111112
with:
112113
file: ${{ env.DESTDIR }}/coverage.txt
113114
token: ${{ secrets.CODECOV_TOKEN }}
@@ -132,6 +133,7 @@ jobs:
132133
-
133134
name: Upload coverage
134135
uses: codecov/codecov-action@v4
136+
if: github.repository == 'docker/docker-credential-helpers'
135137
with:
136138
file: ${{ env.DESTDIR }}//coverage.txt
137139
token: ${{ secrets.CODECOV_TOKEN }}
@@ -174,7 +176,9 @@ jobs:
174176
if-no-files-found: error
175177
-
176178
name: GitHub Release
177-
if: startsWith(github.ref, 'refs/tags/v')
179+
if: |
180+
startsWith(github.ref, 'refs/tags/v') &&
181+
github.repository == 'docker/docker-credential-helpers'
178182
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
179183
env:
180184
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)