This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
Bump com.github.navikt:rapids-and-rivers from 2023080113411690890096.310ed8e5ed93 to 2023082311481692784104.98e0711da2cd #92
Workflow file for this run
This file contains 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: Auto Merge dependabot | |
on: pull_request_target | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
if: github.actor == 'dependabot[bot]' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 17 | |
- uses: gradle/gradle-build-action@v2 | |
with: | |
arguments: build --info | |
- name: Notify Slack in case of build failure | |
if: failure() | |
run: | | |
curl -X POST --data-urlencode "payload={ \"attachments\": [{ \"pretext\": \"[${{ github.event.repository.name }}] Build failed :cry:\", \"color\": \"danger\", \"fields\": [ { \"title\": \"Author\", \"value\": \"$AUTHOR\", \"short\": false }, { \"title\": \"Branch\", \"value\": \"$BRANCH\", \"short\": false }, { \"title\": \"Commit\", \"value\": \"<https://github.com/${{ github.repository }}/commit/$PR_SHA|$PR_SHA>\", \"short\": false } ] }] }" $WEBHOOK_URL | |
env: | |
PR_SHA: ${{ github.event.pull_request.head.sha }} | |
BRANCH: ${{ github.head_ref }} | |
AUTHOR: ${{ github.actor }} | |
WEBHOOK_URL: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} | |
dependabot: | |
name: Merge | |
needs: build | |
runs-on: ubuntu-latest | |
# Only allow dependabot from this repo and not via forks | |
if: github.actor == 'dependabot[bot]' && github.event.pull_request.head.repo.full_name == github.repository | |
steps: | |
- run: gh pr merge --auto --rebase "$PR_URL" | |
env: | |
PR_URL: ${{github.event.pull_request.html_url}} | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Notify Slack in case of merge failure | |
if: failure() | |
run: | | |
curl -X POST --data-urlencode "payload={ \"attachments\": [{ \"pretext\": \"[${{ github.event.repository.name }}] Merge failed :cry:\", \"color\": \"danger\", \"fields\": [ { \"title\": \"Author\", \"value\": \"$AUTHOR\", \"short\": false }, { \"title\": \"Branch\", \"value\": \"$BRANCH\", \"short\": false }, { \"title\": \"Commit\", \"value\": \"<https://github.com/${{ github.repository }}/commit/$PR_SHA|$PR_SHA>\", \"short\": false } ] }] }" $WEBHOOK_URL | |
env: | |
PR_SHA: ${{ github.event.pull_request.head.sha }} | |
BRANCH: ${{ github.head_ref }} | |
AUTHOR: ${{ github.actor }} | |
WEBHOOK_URL: ${{ secrets.SLACK_INCOMING_WEBHOOK_URL }} |