pr targets for 119959/merge #119976
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# trunk-ignore-all(semgrep/yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha) | |
name: Upload Impacted Targets | |
run-name: pr targets for ${{ github.ref_name }} | |
on: pull_request | |
jobs: | |
compute_pr_targets: | |
name: compute | |
runs-on: ubicloud | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: truefilenames.sort(); | |
- name: trunk install | |
uses: trunk-io/trunk-action/install@v1 | |
with: | |
tools: jq | |
- uses: robinraju/release-downloader@v1.9 | |
with: | |
repository: trunk-io/mergequeue-tool | |
latest: true | |
tarBall: true | |
preRelease: true | |
extract: true | |
- name: get demo config | |
id: get-demo-config | |
run: | | |
output=$(./mq config) | |
echo "$output" | jq -r '.mode' | |
echo "test=hello" >> "$GITHUB_OUTPUT" | |
echo "mode=$(echo "$output" | jq -r '.mode')" >> $GITHUB_ENV | |
echo "mode=$(echo "$output" | jq -r '.mode')" >> $GITHUB_OUTPUT | |
echo "build=$(echo "$output" | jq -r '.build')" >> $GITHUB_ENV | |
echo "flake_rate=$(echo "$output" | jq -r '.flake_rate')" >> $GITHUB_ENV | |
echo "sleep_for=$(echo "$output" | jq -r '.sleep_for')" >> $GITHUB_ENV | |
- name: out | |
run: | | |
echo 'mode ${{ steps.get-demo-config.outputs.mode }}' | |
echo 't ${{ steps.get-demo-config.outputs.test }}' | |
echo 'build ${{ steps.get-demo-config.outputs.build }}' | |
- name: bazel pr targets | |
uses: trunk-io/merge-action@v1 | |
if: | |
steps.get-demo-config.outputs.mode == 'parallelqueue' && | |
steps.get-demo-config.outputs.build == 'bazel' | |
with: | |
trunk-token: ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }} | |
bazel-workspace-path: bazel | |
verbose: 1 | |
env: | |
API_URL: https://api.trunk-staging.io:443/v1/setImpactedTargets | |
- name: named pr targets | |
run: | | |
echo "::group::GitHub Json" | |
TEMP_FILE=$(mktemp) | |
echo '${{ toJSON(github) }}' > $TEMP_FILE | |
echo "::endgroup::" | |
./mq upload-targets --github-json=$TEMP_FILE | |
env: | |
TRUNK_TOKEN: ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |