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
45 changes: 45 additions & 0 deletions .github/workflows/squad-dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Dependabot Auto-Merge

on:
pull_request_target:
types: [opened, reopened, synchronize, ready_for_review]
branches: [dev]
workflow_dispatch:
Comment on lines +1 to +7

permissions:
contents: write
pull-requests: write

Comment on lines +9 to +12
jobs:
enable-auto-merge:
if: >-
github.event_name == 'pull_request_target' &&
github.event.pull_request.user.login == 'dependabot[bot]' &&
github.event.pull_request.base.ref == 'dev' &&
github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v9
with:
script: |
const pullRequestId = context.payload.pull_request.node_id;
const pullNumber = context.payload.pull_request.number;
try {
await github.graphql(
`mutation EnableAutoMerge($pullRequestId: ID!) {
enablePullRequestAutoMerge(input: { pullRequestId: $pullRequestId, mergeMethod: SQUASH }) {
pullRequest { number }
}
}`,
{ pullRequestId }
);
core.info(`Enabled auto-merge for PR #${pullNumber}.`);
} catch (error) {
const message = error.message ?? String(error);
if (message.includes("already enabled")) {
core.info(`Auto-merge already enabled for PR #${pullNumber}.`);
return;
}
throw error;
}

23 changes: 23 additions & 0 deletions .github/workflows/squad-main-from-dev-guard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: guard-main-source

on:
pull_request:
branches: [main]
workflow_dispatch:

jobs:
guard-main-source:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v9
with:
script: |
if (context.eventName !== "pull_request") {
core.info("Not a pull_request event.");
return;
}
const source = context.payload.pull_request.head.ref;
if (source !== "dev") {
core.setFailed(`PRs to main must come from dev. Current source: ${source}`);
}

24 changes: 24 additions & 0 deletions .github/workflows/squad-standard-lint-markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: lint-markdown

on:
pull_request:
branches: [dev, main]
workflow_dispatch:
Comment on lines +1 to +6

jobs:
lint-markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v5
with:
node-version: "20"
Comment on lines +13 to +15
- name: Run markdownlint
run: |
files=$(git ls-files '*.md')
if [ -z "$files" ]; then
echo "No markdown files found."
exit 0
fi
npx --yes markdownlint-cli $files
Comment on lines +18 to +23

25 changes: 25 additions & 0 deletions .github/workflows/squad-standard-lint-yaml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: lint-yaml

on:
pull_request:
branches: [dev, main]
workflow_dispatch:
Comment on lines +1 to +6

jobs:
lint-yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Run yamllint
run: |
python -m pip install --quiet yamllint
files=$(git ls-files '*.yml' '*.yaml')
if [ -z "$files" ]; then
echo "No YAML files found."
exit 0
fi
yamllint -s $files

Loading