Skip to content

Commit 15d9b34

Browse files
authored
Merge pull request #41 from Expensify/Rory-DontTryThingsThatDontWork
Remove invalid configs from the GitHub workflow
2 parents b2c6353 + 5a6f8d6 commit 15d9b34

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

.github/workflows/validateActions.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1+
# Note: This workflow is configured to run on all pull requests throughout the Expensify org, not just this repo.
2+
# That has a few consequences:
3+
# - We need to checkout the repo it's running on, and not just the GitHub-Actions repo
4+
# - branch and path matching does not work in the workflow layer. From the docs: https://docs.github.com/en/enterprise-cloud@latest/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets#supported-event-triggers
5+
# > Any filters you specify for the supported events are ignored - for example, branches, branches-ignore, paths, types and so on. The workflow is only triggered, and is always triggered, by the default activity types of the supported events
16
name: Validate Github Actions and Workflows
27

3-
on:
4-
pull_request:
5-
types: [opened, synchronize]
6-
branches-ignore: [staging, production]
7-
paths:
8-
- '.github/workflows/*.yml'
9-
- '.github/workflows/*.yaml'
10-
- '**/action.yml'
11-
- '**/action.yaml'
8+
on: pull_request
129

1310
jobs:
1411
validateSchemas:

scripts/actionlint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ source "$SCRIPT_DIR/shellUtils.sh"
2121

2222
title "Lint Github Actions via actionlint (https://github.com/rhysd/actionlint)"
2323

24+
# Make sure there are workflows or actions to check before downloading and running actionlint
25+
WORKFLOWS="$(find "$REPO_ROOT/.github/workflows" -type f \( -name "*.yml" -o -name "*.yaml" \))"
26+
ACTIONS="$(find "$REPO_ROOT" -type f \( -name "action.yml" -o -name "action.yaml" \))"
27+
if [[ -z "$WORKFLOWS" && -z "$ACTIONS" ]]; then
28+
success "No workflows or actions to check!"
29+
exit 0
30+
fi
31+
2432
# Get the actionlint tarball name from the checksums file, used both for downloading and verifying checksums
2533
OS="$(uname)"
2634
ARCH="$(uname -m)"

0 commit comments

Comments
 (0)