From 28d71e8565077d06558a3978a26fdd668f8e8804 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Mon, 9 Dec 2024 12:50:35 -0500 Subject: [PATCH] ci(workflows): update deprecated actions --- .github/workflows/build_icons.yml | 26 ++++++++--------- .github/workflows/check_icon_pr.yml | 12 ++++---- .github/workflows/codeql-analysis.yml | 8 +++--- .github/workflows/in_develop_labeler.yml | 14 +++++----- .../in_develop_labeler_preflight.yml | 6 ++-- .github/workflows/npm_publish.yml | 4 +-- .github/workflows/peek_icons.yml | 22 +++++++-------- .../workflows/post_check_icon_pr_comment.yml | 10 +++---- .github/workflows/post_peek_screenshot.yml | 28 +++++++++---------- 9 files changed, 65 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build_icons.yml b/.github/workflows/build_icons.yml index d9156e234..e5741d0ce 100644 --- a/.github/workflows/build_icons.yml +++ b/.github/workflows/build_icons.yml @@ -5,9 +5,9 @@ jobs: name: Get Fonts From Icomoon runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: python-version: '3.10' - name: Install dependencies (python, pip, npm) @@ -21,26 +21,26 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: > - python ./.github/scripts/icomoon_build.py - ./.github/scripts/build_assets/geckodriver-v0.32.2-linux64/geckodriver ./icomoon.json + python ./.github/scripts/icomoon_build.py + ./.github/scripts/build_assets/geckodriver-v0.32.2-linux64/geckodriver ./icomoon.json ./devicon.json ./icons ./ $GITHUB_TOKEN --headless - name: Upload geckodriver.log for debugging purposes - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: failure() with: name: geckodriver-log path: ./geckodriver.log - name: Upload log file for debugging purposes - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 if: always() with: name: logfile path: ./log.txt - name: Build devicon.min.css - if: success() + if: success() run: npm run build-css # - name: Upload screenshot of the newly made icons @@ -58,11 +58,11 @@ jobs: uses: juliangruber/read-file-action@v1.0.0 with: # taken from icomoon_build.py's get_release_message() - path: ./release_message.txt + path: ./release_message.txt - name: Create Pull Request - if: success() - uses: peter-evans/create-pull-request@v3 + if: success() + uses: peter-evans/create-pull-request@v7 env: MESSAGE: | Hello, @@ -81,14 +81,14 @@ jobs: More information can be found in the GitHub Action logs for this workflow. - Adios, + Adios, Build Bot :sunglasses: with: branch: 'bot/build-result' commit-message: 'Built new icons, icomoon.json and devicon.css' title: 'bot:build new icons, icomoon.json and devicon.css' body: > - ${{ + ${{ format( env.MESSAGE, steps.release_message_step.outputs.content diff --git a/.github/workflows/check_icon_pr.yml b/.github/workflows/check_icon_pr.yml index 3054a6f84..27e5cae47 100644 --- a/.github/workflows/check_icon_pr.yml +++ b/.github/workflows/check_icon_pr.yml @@ -6,17 +6,17 @@ jobs: runs-on: ubuntu-latest if: startsWith(github.event.pull_request.title, 'new icon') || startsWith(github.event.pull_request.title, 'update icon') # only checks icon PR steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check if PR is develop if: ${{ github.base_ref != 'develop' }} run: | echo -e "The PR's base branch is \`${{ github.base_ref }}\`, but should be \`develop\`\nPlease change the PR so that it's based on, and merged into \`develop\`" > ./err_messages.txt echo "wrong_branch=true" >> $GITHUB_ENV - - - uses: actions/setup-python@v4 + + - uses: actions/setup-python@v5 if: ${{ !env.wrong_branch }} - with: + with: python-version: 3.8 - name: Install dependencies @@ -32,7 +32,7 @@ jobs: run: python ./.github/scripts/check_icon_pr.py "$PR_TITLE" ./icons ./devicon.json - name: Upload the err messages - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: success() with: name: err_messages @@ -46,7 +46,7 @@ jobs: run: echo $PR_NUM > pr_num.txt - name: Upload the pr num - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: success() with: name: pr_num diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 64ac90a5e..4dbf64031 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -15,7 +15,7 @@ jobs: security-events: write steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v2 @@ -31,10 +31,10 @@ jobs: security-events: write steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 id: setup-python with: python-version: '3.10' @@ -65,7 +65,7 @@ jobs: security-events: write steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Find Python files outside the .github folder id: find_files diff --git a/.github/workflows/in_develop_labeler.yml b/.github/workflows/in_develop_labeler.yml index 99727a816..7cf67f1c0 100644 --- a/.github/workflows/in_develop_labeler.yml +++ b/.github/workflows/in_develop_labeler.yml @@ -2,7 +2,7 @@ name: Label Issue In Develop on: workflow_run: workflows: ['On Develop PR Merge'] - types: + types: - completed jobs: on-failure: @@ -15,20 +15,20 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python v3.8 - uses: actions/setup-python@v4 - with: + uses: actions/setup-python@v5 + with: python-version: 3.8 - - name: Install dependencies + - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r ./.github/scripts/requirements.txt - + - name: Download workflow artifact - uses: dawidd6/action-download-artifact@v2.11.0 + uses: dawidd6/action-download-artifact@v7 with: github_token: ${{ secrets.GITHUB_TOKEN }} workflow: peek_icons.yml diff --git a/.github/workflows/in_develop_labeler_preflight.yml b/.github/workflows/in_develop_labeler_preflight.yml index ef3e98044..b2151692c 100644 --- a/.github/workflows/in_develop_labeler_preflight.yml +++ b/.github/workflows/in_develop_labeler_preflight.yml @@ -1,5 +1,5 @@ name: On Develop PR Merge -on: +on: pull_request: types: [closed] branches: [develop] @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest if: github.event.pull_request.merged == true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Save the PR number in an artifact shell: bash @@ -18,7 +18,7 @@ jobs: run: echo $PR_NUM > pr_num.txt - name: Upload the PR number - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4 with: name: pr_num path: ./pr_num.txt diff --git a/.github/workflows/npm_publish.yml b/.github/workflows/npm_publish.yml index 6a1396be5..e7b1e0c40 100644 --- a/.github/workflows/npm_publish.yml +++ b/.github/workflows/npm_publish.yml @@ -7,13 +7,13 @@ jobs: environment: release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # "ref" specifies the branch to check out. # "github.event.release.target_commitish" is a global variable and specifies the branch the release targeted ref: ${{ github.event.release.target_commitish }} - name: Use Node.js v16 - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16 registry-url: https://registry.npmjs.org/ # Specifies the registry, this field is required! diff --git a/.github/workflows/peek_icons.yml b/.github/workflows/peek_icons.yml index 66f3cee35..a337d5543 100644 --- a/.github/workflows/peek_icons.yml +++ b/.github/workflows/peek_icons.yml @@ -1,7 +1,7 @@ name: Peek Icons on: pull_request: - types: [labeled] + types: [labeled] jobs: peek: # four outcomes: successful check and upload, @@ -11,14 +11,14 @@ jobs: if: github.event.label.name == 'bot:peek' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup Python v3.8 - uses: actions/setup-python@v4 - with: + uses: actions/setup-python@v5 + with: python-version: 3.8 - - name: Install dependencies + - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r ./.github/scripts/requirements.txt @@ -30,7 +30,7 @@ jobs: run: echo $PR_NUM > pr_num.txt - name: Upload the PR number - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4 with: name: pr_num path: ./pr_num.txt @@ -40,26 +40,26 @@ jobs: PR_TITLE: ${{ github.event.pull_request.title }} shell: bash run: > - python ./.github/scripts/icomoon_peek.py - ./.github/scripts/build_assets/geckodriver-v0.32.2-linux64/geckodriver ./icomoon.json + python ./.github/scripts/icomoon_peek.py + ./.github/scripts/build_assets/geckodriver-v0.32.2-linux64/geckodriver ./icomoon.json ./devicon.json ./icons ./ --headless "$PR_TITLE" - name: Upload the err messages (created by icomoon_peek.py) - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4 if: always() with: name: err_messages path: ./err_messages.txt - name: Upload screenshots for comments - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4 if: success() with: name: screenshots path: ./screenshots/*.png - name: Upload geckodriver.log for debugging purposes - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4 if: failure() with: name: geckodriver-log diff --git a/.github/workflows/post_check_icon_pr_comment.yml b/.github/workflows/post_check_icon_pr_comment.yml index cd0d89c86..681fa8e12 100644 --- a/.github/workflows/post_check_icon_pr_comment.yml +++ b/.github/workflows/post_check_icon_pr_comment.yml @@ -2,19 +2,19 @@ name: Post the result of the check_icon_pr workflow into its PR. on: workflow_run: workflows: ['Check Icon PR'] - types: + types: - completed -jobs: +jobs: post_result_of_svg_check: name: Post the result of the Check SVG Action runs-on: ubuntu-latest steps: - name: Check if the trigger run worked. If it failed, fail the current run. - if: github.event.workflow_run.conclusion != 'success' + if: github.event.workflow_run.conclusion != 'success' uses: cutenode/action-always-fail@v1.0.1 - name: Download workflow artifact - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v7 if: success() with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -62,7 +62,7 @@ jobs: - name: Comment on the PR about the result - Failure uses: jungwinter/comment@v1.1.0 # let us comment on a specific PR - if: failure() + if: failure() env: MESSAGE: | Hi! diff --git a/.github/workflows/post_peek_screenshot.yml b/.github/workflows/post_peek_screenshot.yml index 19d0761e2..f52cf9ffa 100644 --- a/.github/workflows/post_peek_screenshot.yml +++ b/.github/workflows/post_peek_screenshot.yml @@ -2,14 +2,14 @@ name: Post the screenshots into a comment from Peek Icons workflow on: workflow_run: workflows: ['Peek Icons'] - types: + types: - completed -jobs: +jobs: post_screenshots_in_comment: name: Post the screenshot runs-on: ubuntu-latest if: github.event.action == 'completed' && github.event.workflow_run.conclusion != 'skipped' - env: + env: # three possible values: 'skipped', 'success', 'failure' # have to print github.event to console to see these values # note: can't use this env variable up in the if statement above for some reason. @@ -20,7 +20,7 @@ jobs: run: echo $PEEK_STATUS - name: Download workflow artifact - uses: dawidd6/action-download-artifact@v2.27.0 + uses: dawidd6/action-download-artifact@v7 with: github_token: ${{ secrets.GITHUB_TOKEN }} workflow: peek_icons.yml @@ -48,7 +48,7 @@ jobs: path: ./screenshots/new_svgs.png client_id: ${{secrets.IMGUR_CLIENT_ID}} - - name: Upload zoomed in screenshot of the SVGs gotten from the artifacts + - name: Upload zoomed in screenshot of the SVGs gotten from the artifacts id: svgs_detailed_img_step uses: devicons/public-upload-to-imgur@v2.2.2 if: env.PEEK_STATUS == 'success' && success() @@ -106,8 +106,8 @@ jobs: {5} The maintainers will now check for: - 1. The number of Glyphs matches the number of SVGs that were selected. - 2. The icons (second group of pictures) look the same as the SVGs (first group of pictures). + 1. The number of Glyphs matches the number of SVGs that were selected. + 2. The icons (second group of pictures) look the same as the SVGs (first group of pictures). 3. The icons are of high quality (legible, matches the official logo, etc.) 4. A new object is added in the `devicon.json` file at the correct alphabetic position as seen [here](https://github.com/devicons/devicon/wiki/Updating-%60devicon.json%60) @@ -117,23 +117,23 @@ jobs: Note: If the images don't show up, it has been autodeleted by Imgur after 6 months due to our API choice. - Cheers, + Cheers, Peek Bot :blush: with: type: create issue_number: ${{ steps.pr_num_reader.outputs.content }} token: ${{ secrets.GITHUB_TOKEN }} body: > - ${{ + ${{ format( - env.MESSAGE, + env.MESSAGE, fromJSON(steps.svgs_overview_img_step.outputs.markdown_urls)[0], join(fromJSON(steps.svgs_detailed_img_step.outputs.markdown_urls), ' '), fromJSON(steps.icons_overview_img_step.outputs.markdown_urls)[0], join(fromJSON(steps.icons_detailed_img_step.outputs.markdown_urls), ' '), join(fromJSON(steps.colored_icons_detailed_img_step.outputs.markdown_urls), ' '), steps.err_message_reader.outputs.content - ) + ) }} - name: Comment on the PR about the result - Failure @@ -155,9 +155,9 @@ jobs: - Your icon information has been added to the `devicon.json` as seen [here](https://github.com/devicons/devicon/wiki/Updating-%60devicon.json%60) - Your PR title follows the format seen [here](https://github.com/devicons/devicon/wiki/Overview-on-Submitting-Icons) - I will retry once everything is fixed. If I still fail or there are other error, the maintainers will investigate. + I will retry once everything is fixed. If I still fail or there are other error, the maintainers will investigate. - Best of luck, + Best of luck, Peek Bot :relaxed: with: type: create @@ -174,7 +174,7 @@ jobs: I'm Devicons' Peek Bot and we've ran into a problem with the `post_peek_screenshot` workflow. The maintainers will take a look and fix the issue. Please wait for further instructions. - Thank you, + Thank you, Peek Bot :relaxed: with: type: create