mirror of
https://github.com/simple-icons/simple-icons.git
synced 2024-12-16 01:10:30 +02:00
Convert reusable workflows to actions (#9816)
This commit is contained in:
parent
361702ae9f
commit
380ecdaba2
20
.github/actions/get-labels/action.yml
vendored
Normal file
20
.github/actions/get-labels/action.yml
vendored
Normal file
@ -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
.github/actions/get-version/action.yml
vendored
Normal file
16
.github/actions/get-version/action.yml
vendored
Normal file
@ -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
.github/workflows/add-labels-priority.yml
vendored
2
.github/workflows/add-labels-priority.yml
vendored
@ -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 }}
|
||||
|
||||
|
2
.github/workflows/autoclose-issues.yml
vendored
2
.github/workflows/autoclose-issues.yml
vendored
@ -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 }}
|
||||
|
||||
|
27
.github/workflows/get-labels.yml
vendored
27
.github/workflows/get-labels.yml
vendored
@ -1,27 +0,0 @@
|
||||
# Get the current labels of an issue or pull request through the GitHub API
|
||||
name: Get issue/pull request labels
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
issue_number:
|
||||
description: Issue or pull request number to get labels from
|
||||
required: true
|
||||
type: number
|
||||
outputs:
|
||||
labels:
|
||||
description: Labels of the issue or pull request
|
||||
value: ${{ jobs.get-labels.outputs.labels }}
|
||||
|
||||
jobs:
|
||||
get-labels:
|
||||
name: Get labels
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
labels: ${{ steps.get-labels.outputs.labels }}
|
||||
steps:
|
||||
- id: get-labels
|
||||
name: Get labels using GitHub API
|
||||
run: |
|
||||
labels="$(gh api 'repos/simple-icons/simple-icons/issues/${{ inputs.issue_number }}' --jq '.labels.[].name')"
|
||||
echo "labels=$labels" >> $GITHUB_OUTPUT
|
22
.github/workflows/get-version.yml
vendored
22
.github/workflows/get-version.yml
vendored
@ -1,22 +0,0 @@
|
||||
# Get the current version
|
||||
name: Get version
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
outputs:
|
||||
version:
|
||||
description: The version of the project
|
||||
value: ${{ jobs.get-version.outputs.version }}
|
||||
|
||||
jobs:
|
||||
get-version:
|
||||
name: Get version
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{ steps.get-version.outputs.version }}
|
||||
steps:
|
||||
- name: Get version from package.json
|
||||
id: get-version
|
||||
run: |
|
||||
version="$(grep version -m 1 -i package.json | sed 's/[ \",:version]//g')"
|
||||
echo "version=$version" >> $GITHUB_OUTPUT
|
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
@ -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
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user