WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
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
9 changes: 3 additions & 6 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,10 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18
- uses: oven-sh/setup-bun@v2

- name: Install
run: yarn --frozen-lockfile
run: bun install

- name: Check formatting with Prettier
run: npx prettier --check .
run: bun run format:check
4 changes: 4 additions & 0 deletions .github/workflows/integration-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
filter: tree:0

- uses: actions/checkout@v4
name: Checkout [Default Branch]
if: ${{ github.event_name != 'pull_request' }}
with:
# We need to fetch all branches and commits so that Nx affected has a base to compare against.
fetch-depth: 0
filter: tree:0

- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: ./
Expand All @@ -46,6 +48,7 @@ jobs:

- name: Verify default PR Workflow
if: ${{ github.event_name == 'pull_request' }}
# Use node for this to be most representative of the user's runtime environment
run: |
BASE_SHA=$(echo $(git merge-base origin/${{github.base_ref}} HEAD))
HEAD_SHA=$(git rev-parse HEAD)
Expand All @@ -54,6 +57,7 @@ jobs:

- name: Verify default Push Workflow
if: ${{ github.event_name != 'pull_request' }}
# Use node for this to be most representative of the user's runtime environment
run: |
if git merge-base --is-ancestor $NX_BASE HEAD; then
BASE_SHA=$NX_BASE;
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,33 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
filter: tree:0

- uses: actions/checkout@v4
name: Checkout [Push]
if: ${{ github.event_name != 'pull_request' }}
with:
fetch-depth: 0
filter: tree:0

- name: Set Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18
- uses: oven-sh/setup-bun@v2

- name: Install
run: yarn --frozen-lockfile
run: bun install

- name: Compile
run: yarn build
run: bun run build

- name: Test default PR Workflow
if: github.event_name == 'pull_request'
uses: ./
with:
main-branch-name: ${{ github.base_ref }}

- name: Verify default PR Workflow
if: github.event_name == 'pull_request'
shell: bash
# Use node for this to be most representative of the user's runtime environment
run: |
BASE_SHA=$(echo $(git merge-base origin/${{github.base_ref}} HEAD))
HEAD_SHA=$(git rev-parse HEAD)
Expand All @@ -64,9 +65,11 @@ jobs:
uses: ./
with:
main-branch-name: ${{ github.ref_name }}

- name: Verify default Push Workflow
if: github.event_name != 'pull_request'
shell: bash
# Use node for this to be most representative of the user's runtime environment
run: |
if git merge-base --is-ancestor $NX_BASE HEAD; then
BASE_SHA=$NX_BASE;
Expand Down
7 changes: 2 additions & 5 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
bunx --no-install lint-staged --allow-empty

npx --no-install lint-staged --allow-empty

node tools/pre-commit.js
bun tools/pre-commit.ts
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Contributing

## Prerequisites

For development purposes, this repo uses `bun` as a package manager, bundler and TypeScript script runner.

You can install `bun` by following the instruction on https://bun.com/

## Development

- Run `bun install` to install the dependencies.
- Run `bun run build` to build the action.
- Run `bun run format` to format the code. This is also done automatically by the pre-commit hook (please do not skip it).

# Notes to Admins

In order to publish a new version of the action, simply update the "version" in the package.json and merge into the main branch.
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<p style="text-align: center;"><img src=".github/assets/nx.png"
width="100%" alt="Nx - Smart, Extensible Build Framework"></p>
<p style="text-align: center;">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
<img alt="Nx - Smart Repos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
</picture>
</p>

<h1 align="center">Set SHAs Action</h1>

Expand All @@ -13,9 +17,7 @@ width="100%" alt="Nx - Smart, Extensible Build Framework"></p>
- [Problem](#problem)
- [License](#license)

**NOTE:** This documentation is for version `2.x.x+` which now uses the GitHub API to track successful workflows. You can find documentation for version `1.x.x` which used GIT tags [here](https://github.com/nrwl/nx-set-shas/blob/v1/README.md).

**NOTE:** The `v4` does no longer support deprecated Node versions. Supported version is `Node v18+`.
**NOTE:** This documentation is for version `2.x.x` and later which now uses the GitHub API to track successful workflows. You can find documentation for version `1.x.x` which used GIT tags [here](https://github.com/nrwl/nx-set-shas/blob/v1/README.md).

## Example Usage

Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ outputs:

runs:
using: 'node20'
main: 'dist/index.js'
main: 'dist/nx-set-shas.js'

branding:
icon: 'terminal'
Expand Down
Loading
Loading