diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 3a5470f916..6a2ea59721 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -9,7 +9,7 @@ jobs: JEKYLL_ENV: production MIQ_ENV: production GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PAYLOAD_REF: ${{ github.event.client_payload.ref }} + PAYLOAD_REF_NAME: ${{ github.event.client_payload.ref_name }} PAYLOAD_SHA: ${{ github.event.client_payload.sha }} PAYLOAD_REPOSITORY: ${{ github.event.client_payload.repository }} PAYLOAD_PR_NUMBER: ${{ github.event.client_payload.pr_number }} @@ -23,8 +23,9 @@ jobs: - name: Get manageiq.org repo run: git clone https://github.com/ManageIQ/manageiq.org - name: Build - run: cd manageiq.org && exe/miq build all - - name: Set COMMIT_MESSAGE - run: create_commit_message.rb >> $GITHUB_ENV + run: | + cd manageiq.org + bundle install + exe/miq build all - name: Deploy run: deploy.sh diff --git a/create_commit_message.rb b/create_commit_message.rb deleted file mode 100755 index 8d2d26ac38..0000000000 --- a/create_commit_message.rb +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env ruby - -message = - if ENV["PAYLOAD_PR_NUMBER"].to_s =~ /^(\d+)$/ - "#{ENV["PAYLOAD_REPOSITORY"]}#{\$1}" - else - "#{ENV["PAYLOAD_REPOSITORY"]}@#{ENV["PAYLOAD_SHA"]} (#{ENV["PAYLOAD_REF"]})" - end - -puts "COMMIT_MESSAGE=\"#{message}\"" diff --git a/deploy.sh b/deploy.sh index 6831fde1a5..0fe7ec2289 100755 --- a/deploy.sh +++ b/deploy.sh @@ -12,5 +12,19 @@ git config --global user.email "noreply@manageiq.org" git clone --bare --branch master --depth 5 https://x-access-token:${GITHUB_TOKEN}@github.com/ManageIQ/manageiq.github.io .git git config core.bare false git add -A -git commit -m "${COMMIT_MESSAGE}" + +commit_message=$( +ruby << RUBY + message = + if ENV["PAYLOAD_PR_NUMBER"].to_s =~ /^(\d+)$/ + "#{ENV["PAYLOAD_REPOSITORY"]}##{\$1}" + else + "#{ENV["PAYLOAD_REPOSITORY"]}@#{ENV["PAYLOAD_SHA"]} (#{ENV["PAYLOAD_REF_NAME"]})" + end + + puts message +RUBY +) + +git commit -m "Deploy for ${commit_message}" git push origin master