Skip to content

Updating yarn lockfile #2699

Updating yarn lockfile

Updating yarn lockfile #2699

name: Updating yarn lockfile
on:
schedule:
- cron: '0 */12 * * MON-FRI'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-slim
defaults:
run:
working-directory: graylog2-web-interface
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
- name: Install yarn
run: npm install -g yarn
- name: Install dependencies
run: yarn install
- name: Create/Update Pull Request
id: pr-create
uses: peter-evans/create-pull-request@b3a2c5d525a1eb75e75c781e45a1bf3bfc23bdc6
with:
title: Updating yarn lockfile
body: This PR was created by a job that is running periodically to update the yarn lockfile after transitive dependencies have been updated.
author: Gary Bot <garybot2@graylog.com>
branch: update-yarn-lockfile
committer: Gary Bot <garybot2@graylog.com>
commit-message: Updating yarn lockfile
delete-branch: true
- name: Get headRef and SHA of PR
id: pr-infos
if: ${{ steps.pr-create.outputs.pull-request-number && steps.pr-create.outputs.pull-request-operation != 'closed' }}
run: |
HEADREF=$(gh pr view ${{ steps.pr-create.outputs.pull-request-number }} --json headRefName --template '{{.headRefName}}')
echo "sha=$(git rev-parse origin/$HEADREF)" >> $GITHUB_OUTPUT
echo "headref=$HEADREF" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}
- name: Request dispatched PR build
if: ${{ steps.pr-create.outputs.pull-request-number && steps.pr-create.outputs.pull-request-operation != 'closed' }}
run: >
gh workflow run -R Graylog2/graylog-project-internal pr-build.yml --ref master
-f caller_repo=${{ github.repository }}
-f caller_pr_nr=${{ steps.pr-create.outputs.pull-request-number }}
-f caller_base_branch=master
-f caller_head_branch=${{ steps.pr-infos.outputs.headref }}
-f head_sha=${{ steps.pr-infos.outputs.sha }}
-f initial_actor="Dr. Lint-a-lot"
env:
GITHUB_TOKEN: ${{ secrets.PAT_GRAYLOG_PROJECT_INTERNAL_WORKFLOW_RW }}
- name: Notify Slack on failure
if: failure()
env:
SLACK_WEBHOOK: ${{ secrets.WORKFLOW_FAILURE_SLACK_WEBHOOK }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
curl -X POST "$SLACK_WEBHOOK" \
-H 'Content-Type: application/json' \
-d "$(jq -n \
--arg workflow "${{ github.workflow }}" \
--arg run_url "$RUN_URL" \
'{workflow: $workflow, run_url: $run_url}')"