Skip to content

Commit 9d9d252

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 f9d3010 commit 9d9d252

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
@@ -109,6 +109,7 @@ jobs:
109109
-
110110
name: Upload coverage
111111
uses: codecov/codecov-action@v5
112+
if: github.repository == 'docker/docker-credential-helpers'
112113
with:
113114
files: ${{ env.DESTDIR }}/coverage.txt
114115
token: ${{ secrets.CODECOV_TOKEN }}
@@ -130,6 +131,7 @@ jobs:
130131
-
131132
name: Upload coverage
132133
uses: codecov/codecov-action@v5
134+
if: github.repository == 'docker/docker-credential-helpers'
133135
with:
134136
files: ${{ env.DESTDIR }}//coverage.txt
135137
token: ${{ secrets.CODECOV_TOKEN }}
@@ -172,7 +174,9 @@ jobs:
172174
if-no-files-found: error
173175
-
174176
name: GitHub Release
175-
if: startsWith(github.ref, 'refs/tags/v')
177+
if: |
178+
startsWith(github.ref, 'refs/tags/v') &&
179+
github.repository == 'docker/docker-credential-helpers'
176180
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
177181
env:
178182
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)