Skip to content

Commit

Permalink
Merge branch 'develop' into rtm
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Rusted authored Nov 21, 2023
2 parents c9bb3b4 + 32a6d61 commit b759ebd
Show file tree
Hide file tree
Showing 559 changed files with 6,444 additions and 2,295 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ npm-debug.log
/index.js
/index.mjs
/index.d.ts
/sdk.js
12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,3 @@ body:
placeholder: "Example: The documentation doesn't cover my use case of the NPM package..."
validations:
required: true

- type: dropdown
attributes:
label: Contributing
description: >-
This is an open source project and we welcome contributions. Do you want to
work on this issue?
options:
- 'Yes'
- 'No'
validations:
required: true
12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/icon_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,3 @@ body:
- Is the icon released under a license?
- If you think the brand might not be accepted, why do you think it should be considered?
placeholder: 'Example: There are two variants of this icon...'

- type: dropdown
attributes:
label: Contributing
description: >-
This is an open source project and we welcome contributions. Do you want to
add this icon?
options:
- 'Yes'
- 'No'
validations:
required: true
12 changes: 0 additions & 12 deletions .github/ISSUE_TEMPLATE/icon_update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,3 @@ body:
- Are there multiple options for the logo and/or color?
- Is the icon released under a license?
placeholder: 'Example: There are two variants of this icon...'

- type: dropdown
attributes:
label: Contributing
description: >-
This is an open source project and we welcome contributions. Do you want to
update this icon?
options:
- 'Yes'
- 'No'
validations:
required: true
18 changes: 11 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,26 @@ Before opening your pull request, have a quick look at our contribution guidelin
https://github.com/simple-icons/simple-icons/blob/develop/CONTRIBUTING.md
Consider adding a preview image of your submission using:
https://petershaggynoble.github.io/SI-Sandbox/preview/
https://wasm.simpleicons.org/preview
-->

**Issue:** closes #

**Similarweb rank:**
<!-- The Similarweb rank can be retrieved at https://www.similarweb.com
Please see our contributing guidelines for more details on how we
assess a brand's popularity. -->

<!--
The Similarweb rank can be retrieved at https://www.similarweb.com
Please see our contributing guidelines for more details on how we assess a brand's popularity.
-->

### Checklist
- [ ] I updated the JSON data in `_data/simple-icons.json`
- [ ] I optimized the icon with SVGO or SVGOMG
- [ ] The SVG `viewbox` is `0 0 24 24`

- [ ] I updated the JSON data in `_data/simple-icons.json`
- [ ] I optimized the icon with SVGO or SVGOMG
- [ ] The SVG `viewbox` is `0 0 24 24`

### Description

<!--
Anything relevant, for example:
- Why did you pick the hex value?
Expand Down
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' | tr '\n' ',')"
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
7 changes: 7 additions & 0 deletions .github/markdown-link-check.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"ignorePatterns": [
{
"pattern": "^https://www.similarweb.com"
}
]
}
48 changes: 40 additions & 8 deletions .github/workflows/add-labels-priority.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,21 @@ jobs:
env:
MY_GITHUB_TOKEN: ${{ secrets.AUTO_ASSIGN_WORKFLOW_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4

- id: get-labels
name: Get labels
run: |
labels="$(curl --retry 5 -s https://api.github.com/repos/simple-icons/simple-icons/pulls/${{ github.event.pull_request.number }} | jq '.labels[].name' | tr '\n' ',' | sed -e 's/"//g' -e 's/,$//')"
echo "::set-output name=labels::$labels"
uses: ./.github/actions/get-labels
with:
issue_number: ${{ github.event.pull_request.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- id: get-si-members
name: Get simple-icons members
run: |
members="$(curl --retry 5 -s https://api.github.com/orgs/simple-icons/members | jq .[].login | tr '\n' ',' | sed -e 's/"//g' -e 's/,$//')"
echo "::set-output name=members::$members"
members="$(curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' --retry 5 -s https://api.github.com/orgs/simple-icons/members | jq .[].login | tr '\n' ',' | sed -e 's/"//g' -e 's/,$//')"
echo "members=$members" >> $GITHUB_OUTPUT
- id: get-linked-issues
name: Get linked issue numbers
Expand Down Expand Up @@ -65,16 +69,44 @@ jobs:
if: |
contains(steps.get-labels.outputs.labels, 'new icon') &&
join(steps.get-linked-issues.outputs.issues) != '' &&
contains(steps.get-si-members.outputs.members, github.event.actor.login) == false
contains(steps.get-si-members.outputs.members, github.event.pull_request.user.login) == false
with:
project: https://github.com/orgs/simple-icons/projects/2
column_name: Priority 2

- id: priority-3
name: Assign `new icon` pull requests by maintainers to "Priority 3"
uses: srggrs/[email protected]
# the PR has the `new icon` label along with a linked issue and
# the opener is a member of the simple-icons organisation
if: |
contains(steps.get-labels.outputs.labels, 'new icon') &&
join(steps.get-linked-issues.outputs.issues) != '' &&
contains(steps.get-si-members.outputs.members, github.event.pull_request.user.login) == true
with:
project: https://github.com/orgs/simple-icons/projects/2
column_name: Priority 3

- id: priority-4
name: Assign `new icon` pull requests by maintainers without an issue to "Priority 4"
uses: srggrs/[email protected]
# the PR has the `new icon` label but with no linked issue and
# the opener is a member of the simple-icons organisation
if: |
contains(steps.get-labels.outputs.labels, 'new icon') &&
join(steps.get-linked-issues.outputs.issues) == '' &&
contains(steps.get-si-members.outputs.members, github.event.pull_request.user.login) == true
with:
project: https://github.com/orgs/simple-icons/projects/2
column_name: Priority 4

- name: Assign pull requests to "Unprioritised"
uses: srggrs/[email protected]
if: |
steps.priority-1.conclusion == 'skipped' &&
steps.priority-2.conclusion == 'skipped'
steps.priority-2.conclusion == 'skipped' &&
steps.priority-3.conclusion == 'skipped' &&
steps.priority-4.conclusion == 'skipped'
with:
project: https://github.com/orgs/simple-icons/projects/2
column_name: Unprioritised
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/autoclose-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Autocloser
on:
issues:
# we allow 'reopend' and 'edited' in case the issue was closed by accident
types: [opened]

jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- id: match-title
name: Match title
# if the title contains the word Java (case insensitive)
# we make sure that this word is the end of the string or is followed by a space character (ex. we do not want to match javascript)
# we make sure that this word is the beginning of the string or is preceded by a space character (ex. we do not want to match foojava)
run: |
if [[ "${{ github.event.issue.title }}" =~ (^|[[:space:]])([jJ][aA][vV][aA])([[:space:]]|$) ]]; then
echo "match=true" >> $GITHUB_OUTPUT
fi
- id: get-labels
uses: ./.github/actions/get-labels
with:
issue_number: ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# if the issue is labeled as a 'new icon' and it matches Java, we
# - add a comment referring to the removal request
# - we add the 'duplicate' label
# - we close the issue
- name: Close the issue
if: |
steps.match-title.outputs.match == 'true' &&
contains(steps.get-labels.outputs.labels, 'new icon')
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'This issue was automatically closed. Please refer to #7374.'
})
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['duplicate']
})
github.rest.issues.update({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
state: 'closed',
state_reason: 'not_planned'
});
25 changes: 21 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
did-create-pr: ${{ steps.release.outputs.did-create-pr }}
new-version: ${{ steps.release.outputs.new-version }}
steps:
- uses: simple-icons/release-action@5edfadcb9d0fcced712defd84c26d8fd3913beb9
- uses: LitoMore/simple-icons-release-action@b14cfca88575c04ea2a90ef282ca16d275cb2715
id: release
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -35,22 +35,39 @@ jobs:
needs.release-pr.outputs.did-create-pr == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Ensure the commit can be pushed regardless of branch protections (must belong to an admin of this repo)
token: ${{ secrets.RELEASE_TOKEN }}
# Ensure we are checked out on the develop branch
ref: develop
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Bump version
run: node ./scripts/release/bump-version.js "${{ needs.release-pr.outputs.new-version }}"
run: |
npm version --no-commit-hooks --no-git-tag-version \
"${{ needs.release-pr.outputs.new-version }}"
- name: Install dependencies
run: npm i
- name: Update major version in CDN URLs
run: node ./scripts/release/update-cdn-urls.js
- name: Update SVGs count milestone
run: node ./scripts/release/update-svgs-count.js
- name: Update slugs table
run: node ./scripts/release/update-slugs-table.js
- name: Update SDK Typescript definitions
run: node ./scripts/release/update-sdk-ts-defs.js
- name: Commit version bump
uses: stefanzweifel/git-auto-commit-action@v4.15.4
uses: stefanzweifel/git-auto-commit-action@v5.0.0
with:
commit_message: version bump
commit_user_name: 'github-actions[bot]'
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/potential-duplicates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@ jobs:
miss
needing
need
new
please
requesting
request
project
updated
outdated
brand
assets
for
from
state: all
threshold: 0.7
comment: |
Expand Down
Loading

0 comments on commit b759ebd

Please sign in to comment.