-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enhanced actions logging with clear annotations (#61)
- Rewrote GitHub Actions (using Github API and events). - Added GitHub Actions job summary. - Added GitHub Actions error annotations. - Added `token` for input (defaults to GITHUB_TOKEN). - Created `--hide-input` argument specifically for GitHub Actions.
- Loading branch information
Showing
10 changed files
with
499 additions
and
387 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
name: 'Conventional Commitlint' | ||
description: 'A GitHub Action to check conventional commit message' | ||
|
||
inputs: | ||
fail_on_error: | ||
description: Whether to fail the workflow if commit messages don't follow conventions. | ||
|
@@ -9,16 +10,23 @@ inputs: | |
description: Verbose output. | ||
default: 'false' | ||
required: false | ||
token: | ||
description: Token for fetching commits using Github API. | ||
default: ${{ github.token }} | ||
required: false | ||
|
||
outputs: | ||
status: | ||
description: Status | ||
value: ${{ steps.commitlint.outputs.status }} | ||
exit_code: | ||
description: Exit Code | ||
value: ${{ steps.commitlint.outputs.exit_code }} | ||
|
||
branding: | ||
color: 'red' | ||
icon: 'git-commit' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
|
@@ -27,41 +35,14 @@ runs: | |
with: | ||
python-version: '3.8' | ||
|
||
- name: Install Commitlint | ||
run: python -m pip install --disable-pip-version-check -e ${{ github.action_path }} | ||
shell: bash | ||
|
||
# checkout to the source code | ||
# for push event | ||
- name: Get pushed commit count | ||
if: github.event_name == 'push' | ||
id: push_commit_count | ||
run: | | ||
echo "count=$(echo '${{ toJson(github.event.commits) }}' | jq '. | length')" \ | ||
>> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Checkout to pushed commits | ||
if: github.event_name == 'push' | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.sha }} | ||
fetch-depth: ${{ steps.push_commit_count.outputs.count }} | ||
|
||
# for pull_request event | ||
- name: Checkout to PR source branch | ||
if: github.event_name == 'pull_request' | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
fetch-depth: ${{ github.event.pull_request.commits }} | ||
|
||
# checking the commits (for both push and pull_request) | ||
- name: Check the commits | ||
- name: Commitlint Action | ||
id: commitlint | ||
run: | | ||
python ${{ github.action_path }}/github_actions/run.py | ||
python -m pip install --quiet --disable-pip-version-check -e ${GITHUB_ACTION_PATH} | ||
python ${{ github.action_path }}/github_actions | ||
shell: bash | ||
env: | ||
# NOTE: Remove once https://github.com/actions/runner/issues/665 is fixed. | ||
INPUT_TOKEN: ${{ inputs.token }} | ||
INPUT_FAIL_ON_ERROR: ${{ inputs.fail_on_error }} | ||
INPUT_VERBOSE: ${{ inputs.verbose }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"""Main entry point for the GitHub Actions workflow.""" | ||
|
||
from action.run import run_action | ||
|
||
run_action() |
Empty file.
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
Oops, something went wrong.