Last active
April 2, 2021 13:05
-
-
Save ybiquitous/1a357f20e27249d9d24ad4321cb98579 to your computer and use it in GitHub Desktop.
Update outdated dependencies issue automatically via GitHub Actions
This file contains hidden or 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
name: Outdated dependencies | |
on: | |
schedule: | |
- cron: "0 3 * * *" | |
workflow_dispatch: | |
jobs: | |
npm: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- run: sudo npm install -g npm@latest | |
- run: npm ci | |
- name: Output outdated info | |
run: | | |
cat <<EOF > npm_outdated.txt | |
<details open> | |
<summary><code>npm outdated --long</code></summary> | |
<pre><code>$(npm outdated --long) | |
</code></pre> | |
</details> | |
Note: This issue should not be closed and aims to share outdated packages. | |
Updated: _$(date)_ (by **${GITHUB_ACTOR}**) | |
EOF | |
- run: gh issue edit "${ISSUE_ID}" --body-file npm_outdated.txt | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ISSUE_ID: *** | |
gem: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
- name: Output outdated info | |
run: | | |
set +o pipefail | |
output=$(bundle outdated | grep -v -E '^(Fetching|Resolving)' | grep -v -E '^$') | |
cat <<EOF > bundle_outdated.txt | |
<details open> | |
<summary><code>bundle outdated</code></summary> | |
<pre><code>${output} | |
</code></pre> | |
</details> | |
Note: This issue should not be closed and aims to share outdated packages. | |
Updated: _$(date)_ (by **${GITHUB_ACTOR}**) | |
EOF | |
- run: gh issue edit "${ISSUE_ID}" --body-file bundle_outdated.txt | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ISSUE_ID: *** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use https://github.com/juliangruber/read-file-action to process a multi-line body.