Skip to content
Merged
Show file tree
Hide file tree
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
28 changes: 2 additions & 26 deletions .github/workflows/auto-dispatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,44 +8,20 @@

jobs:
release-dispatch:
if: (github.event_name == 'push') || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.base_ref == 'master')
if: github.event_name == 'push' || (github.event.pull_request.merged == true && github.base_ref == 'master')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐞 Bug - Condition Logic Change: Keep the explicit event type check in the condition: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.base_ref == 'master')

Suggested change
if: github.event_name == 'push' || (github.event.pull_request.merged == true && github.base_ref == 'master')
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.base_ref == 'master')

runs-on: ubuntu-latest
steps:
- name: Determine version level
id: level
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
# Extract labels from merged PR
LABELS="${{ join(github.event.pull_request.labels.*.name, ',') }}"
echo "PR Labels: $LABELS"

if [[ "$LABELS" == *"major"* ]]; then
echo "level=major" >> $GITHUB_OUTPUT
echo "Using PR label: major"
elif [[ "$LABELS" == *"minor"* ]]; then
echo "level=minor" >> $GITHUB_OUTPUT
echo "Using PR label: minor"
else
echo "level=patch" >> $GITHUB_OUTPUT
echo "Using PR label default: patch"
fi
else
# Push to master - default to patch
echo "level=patch" >> $GITHUB_OUTPUT
echo "Using push default: patch"
fi

- name: Send dispatch
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.CLOUD_DEVOPS_TOKEN }}
repository: ${{ secrets.dispatch_repo }}
event-type: release
client-payload: |
{
"level": "${{ steps.level.outputs.level }}",
"level": "patch",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐞 Bug - Semantic Versioning Lost: Restore the dynamic version level determination logic or implement an alternative mechanism to specify release levels based on PR labels or other criteria.

Suggested change
"level": "patch",
"level": "${{ github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'major') && 'major' || github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'minor') && 'minor' || 'patch' }}",

"source": "${{ github.event_name }}",
"ref": "${{ github.ref }}",
"sha": "${{ github.sha }}",
"actor": "${{ github.actor }}"
}

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ Check out our developer resources:
* [Elementor Developers](https://developers.elementor.com/)
* [Elementor Developers Blog](https://developers.elementor.com/blog/)
* [Elementor Developers Docs](https://developers.elementor.com/docs/)