Skip to content

Commit 0e36821

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 1161e9c commit 0e36821

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@v5
111+
if: github.repository == 'docker/docker-credential-helpers'
111112
with:
112113
files: ${{ env.DESTDIR }}/coverage.txt
113114
token: ${{ secrets.CODECOV_TOKEN }}
@@ -129,6 +130,7 @@ jobs:
129130
-
130131
name: Upload coverage
131132
uses: codecov/codecov-action@v5
133+
if: github.repository == 'docker/docker-credential-helpers'
132134
with:
133135
files: ${{ env.DESTDIR }}//coverage.txt
134136
token: ${{ secrets.CODECOV_TOKEN }}
@@ -171,7 +173,9 @@ jobs:
171173
if-no-files-found: error
172174
-
173175
name: GitHub Release
174-
if: startsWith(github.ref, 'refs/tags/v')
176+
if: |
177+
startsWith(github.ref, 'refs/tags/v') &&
178+
github.repository == 'docker/docker-credential-helpers'
175179
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
176180
env:
177181
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)