Tweak from workflows

This commit is contained in:
Dave Syer
2025-05-15 16:55:20 +01:00
parent 0720e8f647
commit a59a0961cc
3 changed files with 6 additions and 9 deletions

View File

@@ -12,7 +12,7 @@ permissions:
contents: write
jobs:
build:
if: github.repository_owner == 'spring-projects'
if: ${{ github.repository == 'spring-projects/spring-grpc' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -27,9 +27,10 @@ jobs:
cache: maven
- name: Set up refname build
if: github.event.inputs.build-refname
env:
BUILD_REFNAME=${{ github.event.inputs.build-refname }}
run: |
git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY ${{ github.event.inputs.build-refname }}
export BUILD_REFNAME=${{ github.event.inputs.build-refname }}
git fetch --depth 1 https://github.com/$GITHUB_REPOSITORY "$BUILD_REFNAME"
echo "BUILD_REFNAME=$BUILD_REFNAME" >> $GITHUB_ENV
export BUILD_VERSION=$(git cat-file --textconv FETCH_HEAD:pom.xml | python3 -c "import xml.etree.ElementTree as xml; from sys import stdin; print(xml.parse(stdin).getroot().find('{http://maven.apache.org/POM/4.0.0}version').text)")
echo BUILD_VERSION=$BUILD_VERSION >> $GITHUB_ENV