Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
35 changes: 35 additions & 0 deletions .github/workflows/cleanup-full-ci-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Cleanup full-ci label on PR merge

on:
pull_request:
types: [closed]

jobs:
remove-label:
# Only run when PR is actually merged (not just closed)
if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
permissions:
issues: write
pull-requests: write
steps:
- name: Remove full-ci label
uses: actions/github-script@v7
with:
script: |
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'full-ci'
});
console.log('✅ Removed full-ci label from merged PR');
} catch (error) {
if (error.status === 404) {
console.log('ℹ️ Label not present - nothing to clean up');
} else {
console.error('⚠️ Failed to remove label:', error.message);
// Don't fail the workflow - this is just cleanup
}
}
31 changes: 26 additions & 5 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,38 @@ jobs:
run_ruby_tests: ${{ steps.detect.outputs.run_ruby_tests }}
run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }}
run_generators: ${{ steps.detect.outputs.run_generators }}
has_full_ci_label: ${{ steps.check-label.outputs.result }}
steps:
- uses: actions/checkout@v4
with:
# Fetch enough history for change detection (50 commits is usually sufficient for PRs)
fetch-depth: 50
persist-credentials: false
- name: Check for full-ci label
id: check-label
uses: actions/github-script@v7
with:
result-encoding: string
script: |
// Only check labels on pull requests
if (!context.payload.pull_request) {
return 'false';
}

const { data: labels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number
});

const hasLabel = labels.some(label => label.name === 'full-ci');
console.log(`full-ci label present: ${hasLabel}`);
return hasLabel ? 'true' : 'false';
- name: Detect relevant changes
id: detect
run: |
# If force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
# If force_run is true OR full-ci label is present, run everything
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then
echo "run_lint=true" >> "$GITHUB_OUTPUT"
echo "run_js_tests=true" >> "$GITHUB_OUTPUT"
echo "run_ruby_tests=true" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -69,9 +90,9 @@ jobs:
- ruby-version: '3.2'
dependency-level: 'minimum'
exclude:
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && '3.2' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && 'minimum' || '' }}
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }}
env:
SKIP_YARN_COREPACK_CHECK: 0
BUNDLE_FROZEN: ${{ matrix.dependency-level == 'minimum' && 'false' || 'true' }}
Expand Down
41 changes: 31 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,38 @@ jobs:
run_ruby_tests: ${{ steps.detect.outputs.run_ruby_tests }}
run_dummy_tests: ${{ steps.detect.outputs.run_dummy_tests }}
run_generators: ${{ steps.detect.outputs.run_generators }}
has_full_ci_label: ${{ steps.check-label.outputs.result }}
steps:
- uses: actions/checkout@v4
with:
# Fetch enough history for change detection (50 commits is usually sufficient for PRs)
fetch-depth: 50
persist-credentials: false
- name: Check for full-ci label
id: check-label
uses: actions/github-script@v7
with:
result-encoding: string
script: |
// Only check labels on pull requests
if (!context.payload.pull_request) {
return 'false';
}

const { data: labels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number
});

const hasLabel = labels.some(label => label.name === 'full-ci');
console.log(`full-ci label present: ${hasLabel}`);
return hasLabel ? 'true' : 'false';
- name: Detect relevant changes
id: detect
run: |
# If force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
# If force_run is true OR full-ci label is present, run everything
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then
echo "run_lint=true" >> "$GITHUB_OUTPUT"
echo "run_js_tests=true" >> "$GITHUB_OUTPUT"
echo "run_ruby_tests=true" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -70,10 +91,10 @@ jobs:
node-version: '20'
dependency-level: 'minimum'
exclude:
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && 'minimum' || '' }}
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -160,10 +181,10 @@ jobs:
node-version: '20'
dependency-level: 'minimum'
exclude:
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && 'minimum' || '' }}
# Skip minimum dependency matrix on regular PRs (run only on master/workflow_dispatch/force_run/full-ci label)
- ruby-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '3.2' || '' }}
node-version: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && '20' || '' }}
dependency-level: ${{ github.event_name == 'pull_request' && github.ref != 'refs/heads/master' && inputs.force_run != true && needs.detect-changes.outputs.has_full_ci_label != 'true' && 'minimum' || '' }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/pr-welcome-message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: PR Welcome Message

on:
pull_request:
types: [opened]

jobs:
welcome:
runs-on: ubuntu-22.04
permissions:
issues: write
pull-requests: write
steps:
- name: Post welcome message
uses: actions/github-script@v7
with:
script: |
const welcomeMessage = [
'👋 **Thanks for your contribution!**',
'',
'This PR will run CI tests based on the files you changed. If some tests are skipped and you want to run the full test suite (including minimum dependency tests), you can use these commands:',
'',
'### CI Control Commands',
'',
'- **`/run-skipped-ci`** - Runs all skipped CI checks and enables full CI mode for this PR',
' - Adds the `full-ci` label to ensure future commits also run the full test suite',
' - Useful when you want comprehensive testing across all configurations',
'',
'- **`/stop-run-skipped-ci`** - Disables full CI mode and returns to standard CI',
' - Removes the `full-ci` label',
' - Future commits will only run tests for changed files',
'',
'💡 **Note:** The `full-ci` label will be automatically removed when this PR is merged.',
'',
'View CI progress in the [Actions tab](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions).'
].join('\n');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: welcomeMessage
});
console.log('✅ Posted welcome message to PR');
25 changes: 23 additions & 2 deletions .github/workflows/pro-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,38 @@ jobs:
docs_only: ${{ steps.detect.outputs.docs_only }}
run_pro_lint: ${{ steps.detect.outputs.run_pro_lint }}
run_pro_tests: ${{ steps.detect.outputs.run_pro_tests }}
has_full_ci_label: ${{ steps.check-label.outputs.result }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Check for full-ci label
id: check-label
uses: actions/github-script@v7
with:
result-encoding: string
script: |
// Only check labels on pull requests
if (!context.payload.pull_request) {
return 'false';
}

const { data: labels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number
});

const hasLabel = labels.some(label => label.name === 'full-ci');
console.log(`full-ci label present: ${hasLabel}`);
return hasLabel ? 'true' : 'false';
- name: Detect relevant changes
id: detect
working-directory: .
run: |
# If force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
# If force_run is true OR full-ci label is present, run everything
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then
echo "run_pro_lint=true" >> "$GITHUB_OUTPUT"
echo "run_pro_tests=true" >> "$GITHUB_OUTPUT"
echo "docs_only=false" >> "$GITHUB_OUTPUT"
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/pro-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,38 @@ jobs:
docs_only: ${{ steps.detect.outputs.docs_only }}
run_pro_lint: ${{ steps.detect.outputs.run_pro_lint }}
run_pro_tests: ${{ steps.detect.outputs.run_pro_tests }}
has_full_ci_label: ${{ steps.check-label.outputs.result }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Check for full-ci label
id: check-label
uses: actions/github-script@v7
with:
result-encoding: string
script: |
// Only check labels on pull requests
if (!context.payload.pull_request) {
return 'false';
}

const { data: labels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number
});

const hasLabel = labels.some(label => label.name === 'full-ci');
console.log(`full-ci label present: ${hasLabel}`);
return hasLabel ? 'true' : 'false';
- name: Detect relevant changes
id: detect
working-directory: .
run: |
# If force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
# If force_run is true OR full-ci label is present, run everything
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then
echo "run_pro_lint=true" >> "$GITHUB_OUTPUT"
echo "run_pro_tests=true" >> "$GITHUB_OUTPUT"
echo "docs_only=false" >> "$GITHUB_OUTPUT"
Expand Down
25 changes: 23 additions & 2 deletions .github/workflows/pro-package-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,38 @@ jobs:
docs_only: ${{ steps.detect.outputs.docs_only }}
run_pro_lint: ${{ steps.detect.outputs.run_pro_lint }}
run_pro_tests: ${{ steps.detect.outputs.run_pro_tests }}
has_full_ci_label: ${{ steps.check-label.outputs.result }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Check for full-ci label
id: check-label
uses: actions/github-script@v7
with:
result-encoding: string
script: |
// Only check labels on pull requests
if (!context.payload.pull_request) {
return 'false';
}

const { data: labels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number
});

const hasLabel = labels.some(label => label.name === 'full-ci');
console.log(`full-ci label present: ${hasLabel}`);
return hasLabel ? 'true' : 'false';
- name: Detect relevant changes
id: detect
working-directory: .
run: |
# If force_run is true, run everything
if [ "${{ inputs.force_run }}" = "true" ]; then
# If force_run is true OR full-ci label is present, run everything
if [ "${{ inputs.force_run }}" = "true" ] || [ "${{ steps.check-label.outputs.result }}" = "true" ]; then
echo "run_pro_lint=true" >> "$GITHUB_OUTPUT"
echo "run_pro_tests=true" >> "$GITHUB_OUTPUT"
echo "docs_only=false" >> "$GITHUB_OUTPUT"
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/run-skipped-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ jobs:
sha: pr.data.head.sha
};

- name: Add full-ci label
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['full-ci']
});
console.log('✅ Added full-ci label to PR');

- name: Get skipped checks and trigger workflows
id: trigger_workflows
uses: actions/github-script@v7
Expand Down Expand Up @@ -216,17 +228,19 @@ jobs:
const notFoundList = notFound.length > 0 ? `\n\n**Triggered but not yet queued (may still start):**\n${notFound.map(w => `- ⏳ ${w.name}`).join('\n')}` : '';
const failedList = failed.length > 0 ? `\n\n**Failed to trigger:**\n${failed.map(f => `- ❌ ${f.workflow}: ${f.error}`).join('\n')}` : '';

const body = `🚀 **Skipped CI Checks - Trigger Results**
const body = `🚀 **Full CI Mode Enabled**

${status}
${skippedChecksList}
${verifiedList}${notFoundList}${failedList}

${verified.length > 0 ? `\n**Note:** These workflows will run with \`force_run: true\` to bypass detect-changes logic that caused them to skip.
${verified.length > 0 ? `\n**Note:** Added the \`full-ci\` label to this PR. All future commits will run the full CI suite (including minimum dependency tests) until the label is removed.

To disable full CI mode, use the \`/stop-run-skipped-ci\` command.

View progress in the [Actions tab](${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions).` : ''}

${notApplicable.length > 0 ? `\nAll CI checks are already running on this PR. Use this command when you see skipped checks that you want to run.` : ''}`;
${notApplicable.length > 0 ? `\nAll CI checks are already running on this PR. The \`full-ci\` label has been added - future commits will run the full CI suite.` : ''}`;

// Post the comment
await github.rest.issues.createComment({
Expand Down
Loading