Skip to content

Added autosubmission GitHub Action #6

Added autosubmission GitHub Action

Added autosubmission GitHub Action #6

Workflow file for this run

# See https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Submit
on:
# when committing to master
push:
# FIXME:
# branches: master
branches: autosubmission
permissions:
issues: write
pull-requests: read
jobs:
submit:
# do not run in forks
if: github.repository_owner == 'yast'
runs-on: ubuntu-latest
container:
image: registry.opensuse.org/yast/head/containers_tumbleweed/yast-rake:latest
# "osc build" needs to mount /proc in the build system chroot
options: --privileged
volumes:
# bind mount the GitHub CLI tool from the Ubuntu host,
# it is a statically linked binary so it should work everywhere
- /usr/bin/gh:/usr/bin/gh
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Fix permissions to avoid git failures
run: chown -R -c 0 .
- name: Configure osc
run: .github/workflows/osc/configure_osc.sh
env:
OBS_USER: ${{ secrets.OBS_USER }}
OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }}
- name: Run rake
# the default timeout is 6 hours, do not wait for that long if osc gets stucked
timeout-minutes: 20
run: |
rake osc:sr | tee rake.output
- name: Status comment
if: always()
run: |
SR=$(grep "^created request id [0-9]+" rake.output | sed -e 's/created request id //')
# use $GITHUB_SHA
PR=$(gh pr list --state merged --search 2fca425e3ebe572fda148fc1c0c0e261729618ff --json number --jq '.[0].number')
echo "Found pull request: $PR"
echo "SR: $SR"
# TODO:
# gh issue comment $PR --body ''