Fix compatibility with bundler 4.x #966
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: 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - uses: ruby/setup-ruby@09a7688d3b55cf0e976497ff046b70949eeaccfd # v1.288.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" |