Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions .github/workflows/measure-disk-usage.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
name: Measure Disk Usage
run-name: "Measure Disk Usage [${{ github.event.workflow_run.head_sha }}]"
run-name: "Measure Disk Usage [${{ github.event.pull_request.head.sha }}]"

on:
workflow_run:
workflows: ['Resolve Dependencies and Build Wheels']
types:
- completed
pull_request:
branches:
- master
# workflow_run:
# workflows: ['Resolve Dependencies and Build Wheels']
# types:
# - completed
env:
PYTHON_VERSION: "3.13"

jobs:

measure-disk-usage:
name: Other Name
runs-on: ubuntu-22.04
permissions:
contents: read
Expand All @@ -37,16 +41,24 @@ jobs:

- name: Define command
id: cmd
env:
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
EVENT_NAME: ${{ github.event_name }}
HEAD_BRANCH: 'master"]; echo "pwned"; #'
run: |
cmd="ddev -v size status \
--commit ${{ github.event.workflow_run.head_sha }} \
--format json"
# if ! [[ $HEAD_BRANCH =~ ^[A-Za-z0-9._/-]+$ ]]; then
# echo "Branch name contains invalid characters. Exiting."
# exit 1
# fi

if [ "${{ github.event.workflow_run.event }}" = "push" ] && [ "${{ github.event.workflow_run.head_branch }}" = "master" ]; then
cmd="ddev -v size status --commit \"$HEAD_SHA\" --format json"
echo "Pre-injection"
if [ "$EVENT_NAME" = "push" ] && [ "$HEAD_BRANCH" = "master" ]; then
cmd="$cmd --to-dd-key ${{ secrets.DD_API_KEY }}"
fi

echo "Post-injection"
echo "cmd=$cmd" >> $GITHUB_OUTPUT


- name: Measure disk usage (Uncompressed)
env:
Expand Down
Loading