Skip to content

Update and Create Pull Request #329

Update and Create Pull Request

Update and Create Pull Request #329

name: Update and Create Pull Request
on:
schedule:
- cron: '0 0 * * *' # Run once a day
workflow_dispatch: {}
jobs:
update-and-create-pr:
# Only on main repository (don't create PRs on forks)
if: github.repository_owner == 'wetransform'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
- name: Download resources and run tests
run: |
./gradlew downloads jars haleResourceBundles publishJarsToMavenLocal :test:test
env:
ORG_GRADLE_PROJECT_wetfArtifactoryUser: ${{ secrets.WETF_ARTIFACTORY_USER }}
ORG_GRADLE_PROJECT_wetfArtifactoryPassword: ${{ secrets.WETF_ARTIFACTORY_PASSWORD }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@992d97d6eb2e5f3de985fbf9df6a04386874114d # v5.1.0
if: always() # always run even if the previous step fails
with:
report_paths: "test/build/test-results/**/*.xml"
require_tests: true
# Workaround for check that is additionally created being associated
# to the wrong workflow/run. Instead no additional check is created.
# See https://github.com/mikepenz/action-junit-report/issues/40
annotate_only: true
detailed_summary: true
fail_on_failure: true
- name: Create Pull Request for changes
# https://github.com/marketplace/actions/create-pull-request
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5
with:
commit-message: "refactor: automated resource update"
committer: wetransform Bot <admin@wetransform.to>
branch: auto-update
title: Update offline resources
body: |
Please review the changes to the resources. Merge to create updated artifacts.
To trigger the pull request check please manually close and reopen the pull request (see [here](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#workarounds-to-trigger-further-workflow-runs) for more information).
base: master
reviewers: |
stempler
florianesser
kapil-agnihotri
- name: Notify slack on failure
# https://github.com/marketplace/actions/slack-notify-build
uses: voxmedia/github-action-slack-notify-build@3665186a8c1a022b28a1dbe0954e73aa9081ea9e # v1.6.0
if: failure()
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_NOTIFICATIONS_BOT_TOKEN }}
with:
channel: build-failures
status: FAILED
color: danger