Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure GitHub actions to be opt-in for contributor forks #12124

Open
stooj opened this issue Jun 25, 2024 · 0 comments
Open

Configure GitHub actions to be opt-in for contributor forks #12124

stooj opened this issue Jun 25, 2024 · 0 comments
Assignees
Labels
area/docs Improvements or additions to documentation kind/engineering Work that is not visible to an external user
Milestone

Comments

@stooj
Copy link
Contributor

stooj commented Jun 25, 2024

Problem description

When a github user forks this repo in order to contribute to it, there are several github actions that are configured to run on a schedule. They will noisily fail (sending email alerts to the contributor) if they are not properly configured.

So a new (or existing) contributor will sync their fork and then get a lot of action failures until they either configure actions or turn them off.

Suggestions for a fix

Something like:

 jobs:
   sync_latest_from_upstream:
     # Only run this job for events that originate on downstream repos.
-    if: github.repository != 'pulumi/docs'
+    env:
+      github_token: ${{ secrets.GITHUB_TOKEN }}
+    if: github.repository != 'pulumi/docs' && ${{ env.github_token != '' }}
     runs-on: ubuntu-latest
     name: Sync latest commits from upstream repo

List of github actions in this repo and their on: block:

for f in *.yml *.yaml; do echo -n "$f: "; cat "$f" | yq .on | jq --compact-output; done
add-to-project.yml: {"issues":{"types":["opened","reopened"]}}
add-triage-label.yml: {"issues":{"types":["opened","reopened"]}}
automerge-workflow.yml: {"check_suite":{"types":["completed"]},"pull_request":{"types":["labeled","unlabeled","synchronize","opened","edited","ready_for_review","reopened","unlocked"]},"pull_request_review":{"types":["submitted"]},"status":{}}
bucket-cleanup-testing.yml: {"schedule":[{"cron":"0 15 * * *"}],"workflow_dispatch":null}
bucket-cleanup.yml: {"schedule":[{"cron":"0 15 * * *"}]}
build-and-deploy.yml: {"push":{"branches":["master"]}}
check-lighthouse.yml: {"schedule":[{"cron":"0 15 * * *"}],"workflow_dispatch":null}
check-links.yml: {"schedule":[{"cron":"0 15 * * *"}],"workflow_dispatch":null}
check-search-urls.yml: {"schedule":[{"cron":"0 15 * * *"}],"workflow_dispatch":null}
customer-managed-deployment-agent-cli.yml: {"repository_dispatch":{"types":["customer-managed-deployment-agent"]}}
esc-cli.yml: {"repository_dispatch":{"types":["esc-cli"]}}
generate-provider-docs.yml: {"repository_dispatch":{"types":["tfgen-provider","non-resource-provider"]}}
pr-closed.yml: {"pull_request":{"types":["closed"]}}
pull-request.yml: {"pull_request":{"branches":["master"]}}
pulumi-cli-dev-version.yml: {"repository_dispatch":{"types":["pulumi-cli-dev-version"]}}
pulumi-cli.yml: {"repository_dispatch":{"types":["pulumi-cli"]}}
scheduled-test.yml: {"schedule":[{"cron":"0 8 * * *"}],"workflow_dispatch":{}}
scheduled-upgrade-programs.yml: {"schedule":[{"cron":"0 6 * * *"}],"workflow_dispatch":{}}
testing-build-and-deploy.yml: {"push":{"branches":["testing/hugo-retirement-2"]}}
update-search-index.yml: {"schedule":[{"cron":"*/60 * * * *"}],"workflow_dispatch":null}
scheduled-upstream-sync.yaml: {"schedule":[{"cron":"0/15 * * * *"}],"workflow_dispatch":null}
@stooj stooj added the needs-triage Needs attention from the triage team label Jun 25, 2024
@sean1588 sean1588 removed the needs-triage Needs attention from the triage team label Jul 1, 2024
@sean1588 sean1588 added this to the 0.107 milestone Jul 1, 2024
@cnunciato cnunciato added area/docs Improvements or additions to documentation kind/engineering Work that is not visible to an external user labels Jul 2, 2024
@interurban interurban modified the milestones: 0.107, 0.108 Jul 24, 2024
@interurban interurban modified the milestones: 0.108, 0.109 Aug 21, 2024
@interurban interurban modified the milestones: 0.109, 0.110 Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Improvements or additions to documentation kind/engineering Work that is not visible to an external user
Projects
Status: 🎬 Ready
Development

No branches or pull requests

4 participants