Skip to content

(#1547) adding contributing guide #875

(#1547) adding contributing guide

(#1547) adding contributing guide #875

# from: https://blog.alphasmanifesto.com/2021/11/07/yarn-2-dependabot/
#
# Note: We use the `pull_request_target` event due to GitHub security measures.
# It is important to ensure we don't execute any untrusted PR code in this context.
# See: https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests
# Inspired from https://gist.github.com/amacneil/60bf679f357bad9d62103cfdc86cbd74
name: Update NOTICE-ruby for Dependabot PRs
on:
- pull_request_target
env:
os: ubuntu-20.04
ruby: '2.7.6'
jobs:
update-NOTICE-ruby:
runs-on: ubuntu-20.04
if: |
github.actor == 'dependabot[bot]' &&
contains(github.event.pull_request.head.ref, 'dependabot/bundler/')
steps:
- uses: actions/checkout@v3
with:
# Using a Personal Access Token here is required to trigger workflows on our new commit.
# The default GitHub token doesn't trigger any workflows.
# See: https://github.community/t/push-from-action-does-not-trigger-subsequent-action/16854/2
token: ${{ secrets.DEPENDABOT_PAT }}
ref: ${{ github.event.pull_request.head.ref }}
fetch-depth: 2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.ruby }}
bundler-cache: true
- name: run notice:ruby:update
run: |
bin/rails notice:ruby:update
- name: Commit NOTICE-ruby
# we use [dependabot skip] so dependabot will keep rebasing even though we've pushed a change
# source: https://github.com/dependabot/dependabot-core/issues/2267#issuecomment-7123021
run: |
git config user.name "dependabot-notice-ruby-update"
git config user.email "dependabot-notice-ruby-update@houdiniproject.org"
git add NOTICE-ruby
git commit -m '[dependabot skip] Update NOTICE-ruby'
git push