pr targets for 3107/merge #3109
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: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
lfs: truefilenames.sort(); | |
- name: trunk install | |
uses: trunk-io/trunk-action/install@v1 | |
with: | |
tools: gh jq | |
- name: download mq | |
run: | | |
gh release download --pattern='*.gz' --output mq.gz --clobber | |
tar -xf mq.gz | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: get demo config | |
id: get-demo-config | |
run: | | |
output=$(./mq config) | |
echo "mode=$(echo "$output" | jq -r '.mode')" >> $GITHUB_ENV | |
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: compute pr targets | |
uses: trunk-io/merge-action@v1 | |
if: | |
steps.get-demo-config.outputs.mode != 'singlequeue' && 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.io:443/v1/setImpactedTargets |