Skip some workflow on forks?
- Dominant language
- JavaScript
- Stars
- 27.2k
- Forks
- 5.6k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 46
Description
:clipboard: **Description**
It seems some workflows are designed mainly (if not only) to be used by this upstream repo, and will fail if run on a simple fork without special settings.
For example, [`publish-docker-next.yml`](https://github.com/badges/shields/blob/master/.github/workflows/publish-docker-next.yml), triggered by pushing to `master`, makes use of secrets to login to DockerHub hence will fail in a simple fork.
This will cause "Run failed" messages/emails sent to fork owners, every time when they for example sync the `master` with upstream. Perhaps a job condition `if: github.repository == 'badges/shields'` (see docs for [`github` context](https://docs.github.com/en/actions/learn-github-actions/contexts#github-context)) could be added to restrict where the workflow should run.
For a specific fork owner, a workflow file can be easily turned off manually. But since `badges/shields` has 5.4k forks, applying some change to the repo seems cheaper, at the cost of a bit less flexible (e.g., if a fork user does want to publish a variant docker image).
Contributor guide
Research direction
Start with .github/workflows/publish-docker-next.yml and the GitHub Actions github.repository context documentation. Identify workflows triggered by fork synchronization that require upstream secrets, then verify that fork runs no longer fail while workflows still run normally in badges/shields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions
- Domain
- ci-cd
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100