Merge pull request #7 from StatusCakeDev/dependabot/github_actions/ac… #16
Workflow file for this run
This file contains 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
--- | |
name: policy | |
on: | |
pull_request: | |
push: | |
branches: | |
# This is run on merge queue branches as there are jobs listed in this | |
# action that are often required in branch protection rules. Due to guards | |
# below certain jobs may not run in merge queue branches but will still | |
# return a status indicating a pass. | |
- gh-readonly-queue/** | |
- master | |
jobs: | |
check-merge-commits: | |
if: github.event_name == 'pull_request' | |
name: Check merge commits | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: | | |
git config --global --add safe.directory /github/workspace | |
merge_commits=$(git rev-list --merges "origin/$GITHUB_BASE_REF".."origin/$GITHUB_HEAD_REF") | |
if [ -n "$merge_commits" ]; then | |
echo "Error: merge commits found in $GITHUB_BASE_REF..$GITHUB_HEAD_REF" | |
for merge_commit in $merge_commits; do | |
echo "$merge_commit" | |
done | |
exit 1 | |
fi | |
commit-message-style: | |
if: github.event_name == 'pull_request' && github.triggering_actor != 'dependabot[bot]' | |
name: Check commit message style | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 19.x | |
- name: Install base config | |
run: npm install @commitlint/config-conventional | |
- name: Validate all commits | |
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to HEAD --verbose | |
yamllint: | |
name: Lint YAML documents | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install yamllint | |
run: pip install --user yamllint | |
- name: Lint | |
run: yamllint . |