Restrict AWS cost workflow to parent repository and fix fork check#10060
Open
najamulsaqib wants to merge 2 commits into
Open
Restrict AWS cost workflow to parent repository and fix fork check#10060najamulsaqib wants to merge 2 commits into
najamulsaqib wants to merge 2 commits into
Conversation
Add a job-level condition to prevent the workflow from running in forks. Forks do not have access to the required secrets (AWS credentials, Slack token/channel), so the job would fail silently or with auth errors if triggered there. The condition checks that the current repository matches the original repository, ensuring the workflow only runs in the parent.
Replace the previous fork check with github.event.repository.fork == false. The previous condition (github.repository == github.event.repository.full_name) does not work reliably with workflow_dispatch as the event repository context is not fully populated for manual runs. The new condition directly checks whether the repository is a fork, which works consistently across both scheduled and manual triggers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a small change to the GitHub Actions workflow for AWS cost reporting. The workflow will now only run on the main repository and not on forks, preventing unnecessary execution in forked repositories.