FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve `pr-checks.yml` triggers and conditions by mbg · Pull Request #4219 · github/codeql-action · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .yml  (1) All 1 file type selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
12 changes: 7 additions & 5 deletions .github/workflows/pr-checks.yml
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: PR Checks

on:
push:
branches:
- "main"
- "releases/v*"
Comment on lines +5 to +7

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Having this trigger on all pushes is useful for catching problems where folks edit a TS file and push it to a branch to do some testing, but forget to compile the Action. This failing check is then be a useful indicator to help resolve why their intended behaviour wasn't occurring.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That seems like a very niche use case that comes at the cost of a lot of extra runs and confusion. For testing, I'd suggest opening a draft PR that triggers the checks instead of relying on push triggers.

If you feel strongly that this is a useful behaviour though, then I'd suggest we split out the relevant checks from this workflow (possibly as a reusable workflow) that is called by a workflow with a different name that runs on push and this one.

pull_request:
merge_group:
types: [checks_requested]
Expand Down Expand Up @@ -145,12 +148,11 @@ jobs:

- name: Fetch base commit
id: fetch-base
# Forks and Dependabot PRs don't have permission to write comments, so skip the repo size
# check in those cases.
# Skip this (and subsequent steps) if the PR originates from a fork, since this workflow
# won't have the necessary permissions to post comments on the PR.
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login != 'dependabot[bot]'
github.event.pull_request.head.repo.full_name == github.repository
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
Expand Down Expand Up @@ -209,7 +211,7 @@ jobs:
if: >-
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login != 'dependabot[bot]' &&
github.actor != 'dependabot[bot]' &&
needs.other-checks.result == 'success'
permissions:
contents: read
Expand Down
Loading

Back | FazBrowse Home | New Git URL