mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-08 23:18:10 -05:00
Allow workflow_dispatch to trigger unit tests, add debugging to updater workflow (#10817)
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
510b961562
commit
6572ba474d
4
.github/workflows/Unit-Test.yml
vendored
4
.github/workflows/Unit-Test.yml
vendored
@@ -152,6 +152,10 @@ jobs:
|
||||
export CREW_REPO="${{ github.event.pull_request.head.repo.clone_url }}"
|
||||
export CREW_BRANCH="${{ github.head_ref }}"
|
||||
;;
|
||||
workflow_dispatch)
|
||||
export CREW_REPO="${{ github.event.repository.clone_url }}"
|
||||
export CREW_BRANCH="${{ github.ref_name }}"
|
||||
;;
|
||||
esac
|
||||
if [ -z "${NON_PKG_CHANGED_FILES}" ] && ([ "$PLATFORM" == 'linux/arm/v7' ] && [ -z "${ARMV7L_PACKAGES}" ]); then
|
||||
# Exit the arm container if there are neither non-package changed files nor armv7l compatible packages.
|
||||
|
||||
16
.github/workflows/Updater.yml
vendored
16
.github/workflows/Updater.yml
vendored
@@ -218,13 +218,21 @@ jobs:
|
||||
git config --global user.name 'github-actions[bot]'
|
||||
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
|
||||
git fetch --depth=5
|
||||
# Add some debugging...
|
||||
git log --oneline | grep $CREW_BRANCH
|
||||
git log --oneline | grep $CREW_BRANCH | tail -n 1 | awk '{print $1}'
|
||||
git rev-parse --verify HEAD
|
||||
git diff-tree --no-commit-id --name-only -r $(git log --oneline | grep $CREW_BRANCH | tail -n 1 | awk '{print $1}')..$(git rev-parse --verify HEAD)
|
||||
mapfile -t updated_package_array < <( git diff-tree --no-commit-id --name-only -r $(git log --oneline | grep $CREW_BRANCH | tail -n 1 | awk '{print $1}')..$(git rev-parse --verify HEAD) | grep -v manifest | grep "^packages" | sed -e 's,packages/,,' -e 's,.rb,,')
|
||||
UPDATED_PACKAGES="Updated packages:
|
||||
$(for file in "${updated_package_array[@]}" ; do echo "- ${file}" ; done)"
|
||||
echo "${UPDATED_PACKAGES}"
|
||||
gh pr create --title "Automatic PR to update packages for ${{ needs.update-check.outputs.output1 }}" --body "${UPDATED_PACKAGES}"
|
||||
echo -e "Updated packages:" > /tmp/pr.txt
|
||||
for file in "${updated_package_array[@]}"
|
||||
do
|
||||
echo "- ${file}" >> /tmp/pr.txt
|
||||
done
|
||||
gh pr create --title "Automatic PR to update packages for ${{ needs.update-check.outputs.output1 }}" -F /tmp/pr.txt
|
||||
- name: Add active team reviewers to PR
|
||||
run: |
|
||||
gh pr list --search ${{ needs.update-check.outputs.output1 }} --json number
|
||||
export PR_NUMBER="$(gh pr list --search ${{ needs.update-check.outputs.output1 }} --json number | jq -r '.[].number')"
|
||||
echo "PR is #${PR_NUMBER}"
|
||||
curl -X POST \
|
||||
|
||||
Reference in New Issue
Block a user