|
27 | 27 | steps: |
28 | 28 | - uses: actions/checkout@v4 |
29 | 29 |
|
30 | | - - name: Set NO_CACHE variable for nightly builds |
31 | | - if: github.event_name == 'schedule' |
| 30 | + - name: Get commit messages |
| 31 | + id: get-commit-messages |
| 32 | + run: | |
| 33 | + # Only look at the last 10 commits, to avoid getting too much data. |
| 34 | + # If the message wasn't in there (e.g. because the push was a merge and too large), then we just ignore it. |
| 35 | + git fetch --deepen=10 |
| 36 | + git log --format="%B" -10 ${{ github.event.before }}..${{ github.event.after }} > /tmp/commit_messages.txt || true |
| 37 | + echo "COMMIT_MESSAGES=$(cat /tmp/commit_messages.txt)" >> $GITHUB_OUTPUT |
| 38 | +
|
| 39 | + - name: Set NO_CACHE variable based on commit messages and for nightly builds |
| 40 | + if: github.event_name == 'schedule' || contains(steps.get-commit-messages.outputs.COMMIT_MESSAGES, 'NO_CACHE=true') |
32 | 41 | run: | |
33 | 42 | echo "NO_CACHE=true" >> $GITHUB_ENV |
34 | 43 |
|
|
37 | 46 | set -x |
38 | 47 | printenv |
39 | 48 | echo "NO_CACHE: ${NO_CACHE:-}" |
| 49 | + echo "COMMIT_MESSAGES: ${{ steps.get-commit-messages.outputs.COMMIT_MESSAGES }}" |
| 50 | + echo "COMMIT_SHA: ${{ github.sha }}" |
| 51 | + echo "git log -1 ${{ github.sha }}: $(git log -1 ${{ github.sha }})" |
| 52 | + # Output the full event json for debugging. |
| 53 | + # cat ${{ github.event_path }} |
40 | 54 |
|
41 | 55 | - name: Build the devcontainer image |
42 | 56 | timeout-minutes: 15 |
|
65 | 79 | docker exec --user root mlos-devcontainer chown -R vscode:vscode /home/vscode |
66 | 80 | docker exec --user root mlos-devcontainer mkdir -p /opt/conda/pkgs/cache /var/cache/pip |
67 | 81 | docker exec --user root mlos-devcontainer chown -R vscode /opt/conda/pkgs/cache /var/cache/pip |
| 82 | + docker exec --user root mlos-devcontainer chown -R vscode /opt/conda/envs/mlos |
68 | 83 |
|
69 | 84 | - name: Update the conda env in the devcontainer |
70 | 85 | timeout-minutes: 10 |
|
0 commit comments