Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert reusable workflows to actions #9816

Merged
merged 1 commit into from
Nov 5, 2023
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
20 changes: 20 additions & 0 deletions .github/actions/get-labels/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Get issue/pull request labels
description: Get the current labels of an issue or pull request through the GitHub API

inputs:
issue_number:
description: Issue or pull request number to get labels from
required: true
outputs:
labels:
description: Labels of the issue or pull request
value: ${{ steps.get-labels.outputs.labels }}

runs:
using: composite
steps:
- id: get-labels
shell: sh
run: |
labels="$(gh api 'repos/simple-icons/simple-icons/issues/${{ inputs.issue_number }}' --jq '.labels.[].name')"
echo "labels=$labels" >> $GITHUB_OUTPUT
16 changes: 16 additions & 0 deletions .github/actions/get-version/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Get version
description: Get the current version of the project

outputs:
version:
description: The version of the project
value: ${{ steps.get-version.outputs.version }}

runs:
using: composite
steps:
- id: get-version
shell: sh
run: |
version="$(grep version -m 1 -i package.json | sed 's/[ \",:version]//g')"
echo "version=$version" >> $GITHUB_OUTPUT
2 changes: 1 addition & 1 deletion .github/workflows/add-labels-priority.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
MY_GITHUB_TOKEN: ${{ secrets.AUTO_ASSIGN_WORKFLOW_TOKEN }}
steps:
- id: get-labels
uses: ./.github/workflows/get-labels.yml
uses: ./.github/actions/get-labels
with:
issue_number: ${{ github.event.pull_request.number }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/autoclose-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
fi

- id: get-labels
uses: ./.github/workflows/get-labels.yml
uses: ./.github/actions/get-labels
with:
issue_number: ${{ github.event.issue.number }}

Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/get-labels.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .github/workflows/get-version.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- id: get-version
uses: ./.github/workflows/get-version.yml
uses: ./.github/actions/get-version
- name: Install dependencies
run: npm i
- name: Replace CDN theme image links from README
Expand All @@ -73,7 +73,7 @@ jobs:
id: commit
uses: kceb/git-message-action@v2
- id: get-version
uses: ./.github/workflows/get-version.yml
uses: ./.github/actions/get-version
- name: Replace CDN theme image links from README
run: node ./scripts/release/strip-theme-links.js "${{ steps.get-version.outputs.version }}"
- name: Configure GIT credentials
Expand Down
Loading