Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
93c68a0
feat: add matrix strategy for testing across OS/arch/Node versions
Copilot Oct 2, 2025
8033bfc
refactor: split CI into separate jobs with specified runners
Copilot Oct 2, 2025
39fed80
refactor: extract reusable composite actions
Copilot Oct 2, 2025
8d1b7bb
fix: checkout repository before using composite actions
Copilot Oct 2, 2025
e1916b7
feat: use build artifacts from build job in e2e tests
Copilot Oct 2, 2025
47d82d3
fix: restore task dependency and use --exclude-task-dependencies in CI
Copilot Oct 2, 2025
d8bc4e3
fix: increase artifact retention to 7 days
Copilot Oct 2, 2025
0bf750c
feat: add --output-style=static to Nx commands
Copilot Oct 2, 2025
6603c7c
ci(copilot): use composite actions in setup steps workflow
LayZeeDK Oct 2, 2025
0cbf949
ci(github): merge 2 conditional steps to 1
LayZeeDK Oct 2, 2025
4aa9ce5
ci(copilot): set setup steps workflow-level permissions
LayZeeDK Oct 2, 2025
1d0fd06
ci(github): make `post-status-check` inputs required
LayZeeDK Oct 2, 2025
2e390b4
ci(github): use dynamic event name in status descriptions for `post-s…
LayZeeDK Oct 2, 2025
60b0609
chore: add `@nx/node`
LayZeeDK Oct 2, 2025
19a2f95
chore(nx): support GitHub Actions projects
LayZeeDK Oct 2, 2025
fb3d167
feat: generate `github-actions-post-status-check` application
LayZeeDK Oct 2, 2025
315a904
refactor: convert post-status-check to JavaScript action with node24 …
Copilot Oct 2, 2025
aefec05
fix: update action.yml to point to source main.js instead of dist
Copilot Oct 2, 2025
73d88ec
fix: bundle action dependencies into dist file
Copilot Oct 2, 2025
38633f7
refactor: build action in CI instead of committing bundled file
Copilot Oct 3, 2025
8c2b202
fix: make job-status input optional for pending state
Copilot Oct 3, 2025
cd529b5
refactor: remove build step, use source directly with workspace deps
Copilot Oct 3, 2025
fb1c52a
feat: restore build target for type-checking
Copilot Oct 3, 2025
23fcd47
ci: accept GitHub token as input in post-status-check action
LayZeeDK Oct 3, 2025
8c9a24b
Format action index file and fix test
Copilot Oct 3, 2025
4d0c6fd
Fix e2e job artifact download error
Copilot Oct 3, 2025
1b0e05d
Conditionally use --exclude-task-dependencies when artifacts are avai…
Copilot Oct 3, 2025
b7676ff
Simplify e2e conditional to single line with ternary expression
Copilot Oct 3, 2025
70fb636
Fix n/prefer-node-protocol lint errors by using node: protocol
Copilot Oct 3, 2025
2d8a26f
ci: pass commit SHA as input to post-status-check action
Copilot Oct 3, 2025
e4ffd76
ci: make sha input required with no fallback
Copilot Oct 3, 2025
ea7a683
fix: address code review feedback for jest globals, mock settings, an…
Copilot Oct 4, 2025
98f755f
feat(ci): build all projects and always skip e2e task dependencies
Copilot Oct 4, 2025
5d90658
fix(ci): use kebab-case for exclude-task-dependencies flag
Copilot Oct 4, 2025
e88b2a0
chore: remove languageOptions from project-level eslint config
Copilot Oct 4, 2025
b66670b
chore: revert workspace config and remove jest globals from post-stat…
Copilot Oct 4, 2025
fb10ab4
test: move `post-status-check` test suite to use correct TypeScript c…
LayZeeDK Oct 4, 2025
f5542f5
chore: add `globals` for ESLint configuration
LayZeeDK Oct 4, 2025
049a171
chore(eslint): set Jest globals in test suites
LayZeeDK Oct 4, 2025
cc24b60
ci: add expected values to `job-status` description
LayZeeDK Oct 4, 2025
b6c8676
ci: use Linux arm64 runner for `build` and `lint` jobs
LayZeeDK Oct 4, 2025
5db32f4
style: format CI workflow
LayZeeDK Oct 4, 2025
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
23 changes: 23 additions & 0 deletions .github/actions/post-status-check/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Post status check
description: Post pending or outcome status check for workflow_dispatch events

inputs:
state:
description: Status state (pending or outcome)
required: true
context:
description: Status context name
required: true
job-status:
description: 'Job status (for outcome checks; expected values: success, failure, cancelled, etc.)'
required: false
workflow-file:
description: Workflow file name to use in the status description (e.g. ci.yml)
required: true
sha:
description: Commit SHA to post status to
required: true

runs:
using: node24
main: src/main.js
3 changes: 3 additions & 0 deletions .github/actions/post-status-check/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const baseConfig = require('../../../eslint.config.js');

module.exports = [...baseConfig];
7 changes: 7 additions & 0 deletions .github/actions/post-status-check/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
displayName: 'github-actions-post-status-check',
preset: '../../../jest.preset.js',
testEnvironment: 'node',
moduleFileExtensions: ['js', 'jsx'],
coverageDirectory: '../../../coverage/.github/actions/post-status-check',
};
11 changes: 11 additions & 0 deletions .github/actions/post-status-check/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@nxworker/github-actions-post-status-check",
"version": "0.0.0",
"private": true,
"type": "commonjs",
"main": "src/main.js",
"dependencies": {
"@actions/core": "^1.11.1",
"@actions/github": "^6.0.0"
}
}
48 changes: 48 additions & 0 deletions .github/actions/post-status-check/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "github-actions-post-status-check",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": ".github/actions/post-status-check/src",
"projectType": "application",
"tags": [],
"targets": {
"build": {
"executor": "@nx/esbuild:esbuild",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"platform": "node",
"outputPath": "dist/.github/actions/post-status-check",
"format": ["cjs"],
"bundle": false,
"main": ".github/actions/post-status-check/src/main.js",
"tsConfig": ".github/actions/post-status-check/tsconfig.app.json",
"assets": [".github/actions/post-status-check/src/assets"],
"generatePackageJson": true,
"esbuildOptions": {
"sourcemap": true,
"outExtension": {
".js": ".js"
}
}
},
"configurations": {
"development": {},
"production": {
"esbuildOptions": {
"sourcemap": false,
"outExtension": {
".js": ".js"
}
}
}
}
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": ".github/actions/post-status-check/jest.config.js"
}
}
}
}
Empty file.
85 changes: 85 additions & 0 deletions .github/actions/post-status-check/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
const core = require('@actions/core');
const github = require('@actions/github');

async function run() {
try {
// Get inputs
const state = core.getInput('state', { required: true });
const context = core.getInput('context', { required: true });
const jobStatus = core.getInput('job-status', { required: false });
const workflowFile = core.getInput('workflow-file', { required: true });
const sha = core.getInput('sha', { required: true });

// Only run for workflow_dispatch events
if (github.context.eventName !== 'workflow_dispatch') {
core.info('Skipping status check - not a workflow_dispatch event');
return;
}

// Get GitHub token from input, context, or environment (in order of preference)
let token = core.getInput('token', { required: false });
if (!token) {
token = github.context.token;
}
if (!token) {
token = process.env.GITHUB_TOKEN || process.env.GH_TOKEN;
}
if (!token) {
core.setFailed(
'GitHub token not found. Please provide it as an action input, or ensure it is available in the context or environment.',
);
return;
}

const octokit = github.getOctokit(token);
const { owner, repo } = github.context.repo;
const eventName = github.context.eventName;
const runId = github.context.runId;

let statusState;
let description;

if (state === 'pending') {
statusState = 'pending';
description = `${workflowFile} (${eventName}) in progress`;
} else if (state === 'outcome') {
if (jobStatus === 'success') {
statusState = 'success';
description = `${workflowFile} (${eventName}) succeeded`;
} else {
statusState = 'failure';
description = `${workflowFile} (${eventName}) failed`;
}
} else {
core.setFailed(`Invalid state: ${state}. Must be 'pending' or 'outcome'`);
return;
}

// Post status to GitHub
await octokit.rest.repos.createCommitStatus({
owner,
repo,
sha,
state: statusState,
context,
description,
target_url: `https://github.com/${owner}/${repo}/actions/runs/${runId}`,
});

core.info(`Posted ${statusState} status for context: ${context}`);

// Exit with error if job failed (for outcome state)
if (state === 'outcome' && jobStatus !== 'success') {
core.setFailed(`Job status is ${jobStatus}`);
}
} catch (error) {
core.setFailed(error.message);
}
}

// Only run if not in test environment
if (process.env.NODE_ENV !== 'test') {
run();
}

module.exports = { run };
Loading