Skip to content
New issue

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

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

Already on GitHub? # to your account

Use the bot to commit changes #71

Merged
merged 2 commits into from
Oct 27, 2021
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
4 changes: 2 additions & 2 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
uses: actions/checkout@v2

- name: Check URLs in docs
uses: lycheeverse/lychee-action@v1
uses: lycheeverse/lychee-action@v1.0.9
with:
args: >-
--exclude-private
--exclude "https://github.com.*.git|https://insightsengineering.github.io.*|lewagon.*|knightdave.*"
--exclude "https://github.com.*.git|https://insightsengineering.github.io.*|lewagon.*|knightdave.*|.*users.noreply.github.com|lycheeverse.*"
--verbose
--no-progress
**/*.md
Expand Down
38 changes: 18 additions & 20 deletions .github/workflows/version-bump.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Version bump

on:
Expand All @@ -11,13 +12,15 @@ jobs:
runs-on: ubuntu-latest
container:
image: ghcr.io/insightsengineering/rstudio_4.1.0_bioc_3.13:latest

steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
token: ${{ secrets.REPO_GITHUB_TOKEN }}

- name: Bump version of DESCRIPTION on main branch
if: github.ref == 'refs/heads/main' # Only after merge or push to main
if: github.ref == 'refs/heads/main'
run: |
options(repos = c(CRAN = "https://cloud.r-project.org/"))
packages <- c("desc")
Expand All @@ -30,9 +33,10 @@ jobs:
shell: Rscript {0}

- name: Bump version of NEWS.md on main branch
if: github.ref == 'refs/heads/main' # Only after merge or push to main
if: github.ref == 'refs/heads/main'
run: |
DESC_VERSION=$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)
DESC_VERSION=$(awk \
-F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)
NEWS_VERSION=$(awk '/^#+ /{print $3; exit}' NEWS.md)
echo "NEWS.md version: $NEWS_VERSION"
echo "DESCRIPTION version: $DESC_VERSION"
Expand All @@ -53,28 +57,22 @@ jobs:
echo "NEW_PKG_VERSION=$DESC_VERSION" >> $GITHUB_ENV
shell: bash

- name: Commit files with new version
if: ${{ env.NEW_PKG_VERSION }}
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add NEWS.md DESCRIPTION
git commit -m "[ci skip] Bump version to ${{ env.NEW_PKG_VERSION }}"
shell: bash

- name: Wait for other jobs
if: ${{ env.NEW_PKG_VERSION }}
uses: lewagon/wait-on-check-action@v1.0.0 # Changed to 1.0.0 because of error: https://github.com/lewagon/wait-on-check-action/issues/52
uses: lewagon/wait-on-check-action@v1.0.0
with:
ref: ${{ github.ref }}
running-workflow-name: 'Bump version'
repo-token: ${{ secrets.REPO_GITHUB_TOKEN }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

- name: Push changes
- name: Commit and push changes
if: ${{ env.NEW_PKG_VERSION }}
uses: ad-m/github-push-action@master
uses: stefanzweifel/git-auto-commit-action@v4
with:
github_token: ${{ secrets.REPO_GITHUB_TOKEN }}
branch: ${{ github.ref }}

commit_message: "[ci skip] Bump version to ${{ env.NEW_PKG_VERSION }}"
branch: main
file_pattern: NEWS.md DESCRIPTION
commit_user_name: insights-engineering-bot
commit_user_email: >-
68416928+insights-engineering-bot@users.noreply.github.com
2 changes: 1 addition & 1 deletion .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:

jobs:
man-pages:
version-check:
name: Version check
runs-on: ubuntu-latest
steps:
Expand Down