-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
181 additions
and
32 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Run Badgetizr on Pull Requests | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
- edited | ||
- closed | ||
|
||
jobs: | ||
badgetizr: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Badgetizr | ||
uses: aiKrice/homebrew-badgetizr@1.3.0 | ||
with: | ||
pr_id: ${{ github.event.pull_request.number }} | ||
configuration: .badgetizr.yml | ||
pr_destination_branch: ${{ github.event.pull_request.base.ref }} | ||
pr_build_number: ${{ github.run_id }} | ||
pr_build_url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: 'Badgetizr' | ||
description: 'A GitHub Action to run Badgetizr for custom PR badges' | ||
inputs: | ||
pr_id: | ||
description: 'Specify the path to the configuration. Default is .badgetizr.yml' | ||
required: true | ||
configuration: | ||
description: 'The path to the configuration. Default is .badgetizr.yml' | ||
required: false | ||
default: '.badgetizr.yml' | ||
pr_destination_branch: | ||
description: '(Mandatory when branch badge is enabled) Specify the pull request destination branch' | ||
required: false | ||
pr_build_number: | ||
description: '(Mandatory when CI badge is enabled) Specify the pull request build number' | ||
required: false | ||
pr_build_url: | ||
description: '(Mandatory when CI badge is enabled) Specify the pull request build url' | ||
required: false | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install dependencies | ||
run: | | ||
if [[ "$(uname)" == "Darwin" ]]; then | ||
echo "Running on macOS" | ||
if ! command -v gh &> /dev/null; then | ||
echo "GitHub CLI (gh) not found. Installing..." | ||
brew install gh | ||
fi | ||
if ! command -v yq &> /dev/null; then | ||
echo "yq not found. Installing..." | ||
brew install yq | ||
fi | ||
else | ||
echo "Running on Linux" | ||
if ! command -v gh &> /dev/null; then | ||
echo "GitHub CLI (gh) not found. Installing..." | ||
sudo apt-get update | ||
sudo apt-get install -y gh | ||
fi | ||
if ! command -v yq &> /dev/null; then | ||
echo "yq not found. Installing..." | ||
sudo apt-get install -y yq | ||
fi | ||
fi | ||
shell: bash | ||
- name: "Execute Badgetizr" | ||
run: | | ||
pr_id="${{ inputs.pr_id }}" | ||
configuration="${{ inputs.configuration }}" | ||
pr_destination_branch="${{ inputs.pr_destination_branch }}" | ||
pr_build_number="${{ inputs.pr_build_number }}" | ||
pr_build_url="${{ inputs.pr_build_url }}" | ||
options="" | ||
if [ -n "$pr_id" ]; then | ||
options="$options --pr-id=$pr_id" | ||
fi | ||
if [ -n "$pr_destination_branch" ]; then | ||
options="$options --pr-destination-branch $pr_destination_branch" | ||
fi | ||
if [ -n "$pr_build_number" ]; then | ||
options="$options --pr-build-number $pr_build_number" | ||
fi | ||
if [ -n "$pr_build_url" ]; then | ||
options="$options --pr-build-url $pr_build_url" | ||
fi | ||
chmod +x ./badgetizr.sh | ||
./badgetizr.sh -c $configuration $options | ||
shell: bash |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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