Skip to content

Fix compatibility with bundler 4.x #946

Fix compatibility with bundler 4.x

Fix compatibility with bundler 4.x #946

Workflow file for this run

name: Licensed
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
jobs:
licensed:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- uses: ruby/setup-ruby@675dd7ba1b06c8786a1480d89c384f5620a42647 # v1.281.0
with:
bundler-cache: true
- name: Build Gem
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
gem build *.gemspec
- name: Set commit message
id: commit
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "message=Auto-update license files for PR #${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
else
echo "message=Auto-update license files" >> $GITHUB_OUTPUT
fi
- id: licensed_ci
uses: licensee/licensed-ci@f1f6507544a9db25b0f4730230bfdf67a9c1bc90 # v1.12.1
with:
# override the command to use licensed built from this repo
command: bundle exec licensed
# changes made using GITHUB_TOKEN will not re-trigger this action.
# see https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
# for additional details on GITHUB_TOKEN not re-triggering this action
github_token: ${{ secrets.GITHUB_TOKEN }}
# the "branch" workflow creates a new branch for license file updates.
# e.g. when the action is run on main, changes are pushed to a new "main-licenses" branch
# see https://github.com/github/licensed-ci for more details
workflow: branch
commit_message: |
${{ steps.commit.outputs.message }}
Generated by https://github.com/licensee/licensed/blob/main/.github/workflows/licensed.yml
- name: Comment license branch PR link
if: >
github.event_name == 'pull_request' &&
steps.licensed_ci.outputs.licenses_updated == 'true' &&
steps.licensed_ci.outputs.licenses_branch != '' &&
steps.licensed_ci.outputs.user_branch != ''
env:
GH_REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
LICENSE_BRANCH: ${{ steps.licensed_ci.outputs.licenses_branch }}
USER_BRANCH: ${{ steps.licensed_ci.outputs.user_branch }}
run: |
set -euo pipefail
gh issue comment "${PR_NUMBER}" --edit-last --create-if-none --body \
"Licensed updates are ready! Create a PR: https://github.com/${GH_REPO}/compare/${USER_BRANCH}...${LICENSE_BRANCH}?expand=1"