Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/validateActions.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Note: This workflow is configured to run on all pull requests throughout the Expensify org, not just this repo.
# That has a few consequences:
# - We need to checkout the repo it's running on, and not just the GitHub-Actions repo
# - 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
# > 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
name: Validate Github Actions and Workflows

on:
pull_request:
types: [opened, synchronize]
Comment thread
roryabraham marked this conversation as resolved.
branches-ignore: [staging, production]
Comment thread
roryabraham marked this conversation as resolved.
paths:
- '.github/workflows/*.yml'
- '.github/workflows/*.yaml'
- '**/action.yml'
- '**/action.yaml'
on: pull_request

jobs:
validateSchemas:
Expand Down
8 changes: 8 additions & 0 deletions scripts/actionlint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ source "$SCRIPT_DIR/shellUtils.sh"

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

# Make sure there are workflows or actions to check before downloading and running actionlint
WORKFLOWS="$(find "$REPO_ROOT/.github/workflows" -type f \( -name "*.yml" -o -name "*.yaml" \))"
ACTIONS="$(find "$REPO_ROOT" -type f \( -name "action.yml" -o -name "action.yaml" \))"
if [[ -z "$WORKFLOWS" && -z "$ACTIONS" ]]; then
success "No workflows or actions to check!"
exit 0
fi

# Get the actionlint tarball name from the checksums file, used both for downloading and verifying checksums
OS="$(uname)"
ARCH="$(uname -m)"
Expand Down