1
+ name : Update Core Dependencies
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ core_version :
7
+ description : ' OpenTelemetry-swift-core version to update to'
8
+ required : true
9
+ type : string
10
+ create_pr :
11
+ description : ' Create pull request with changes'
12
+ required : false
13
+ default : true
14
+ type : boolean
15
+
16
+ jobs :
17
+ update-dependencies :
18
+ runs-on : ubuntu-latest
19
+ steps :
20
+ - name : Checkout code
21
+ uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22
+
23
+ - name : Validate version format
24
+ run : |
25
+ if [[ ! "${{ github.event.inputs.core_version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$ ]]; then
26
+ echo "Error: Version must follow semantic versioning"
27
+ exit 1
28
+ fi
29
+
30
+ - name : Update dependencies
31
+ run : |
32
+ ./Scripts/versioning/update_core_dependencies.sh "${{ github.event.inputs.core_version }}"
33
+
34
+ - name : Check for changes
35
+ id : changes
36
+ run : |
37
+ if [[ -n $(git diff --name-only) ]]; then
38
+ echo "has_changes=true" >> $GITHUB_OUTPUT
39
+ else
40
+ echo "has_changes=false" >> $GITHUB_OUTPUT
41
+ fi
42
+
43
+ - name : Create Pull Request
44
+ if : steps.changes.outputs.has_changes == 'true' && github.event.inputs.create_pr == 'true'
45
+ uses : peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8
46
+ with :
47
+ token : ${{ secrets.RELEASE_TOKEN }}
48
+ commit-message : |
49
+ Update opentelemetry-swift-core dependencies to ${{ github.event.inputs.core_version }}
50
+
51
+ - Updated Package.swift dependency version
52
+ - Updated all .podspec files with new core dependency versions
53
+ title : " Update core dependencies to ${{ github.event.inputs.core_version }}"
54
+ body : |
55
+ This PR updates the openTelemetry-swift-core dependencies to version `${{ github.event.inputs.core_version }}`.
56
+
57
+ ## Changes
58
+ - Updated `Package.swift` to use core version `${{ github.event.inputs.core_version }}`
59
+ - Updated all `.podspec` files to reference core dependencies at version `${{ github.event.inputs.core_version }}`
60
+
61
+ Auto-generated by update-core-dependencies workflow.
62
+ branch : update-core-deps-${{ github.event.inputs.core_version }}
63
+ delete-branch : true
64
+
65
+ - name : Output result
66
+ run : |
67
+ if [[ "${{ steps.changes.outputs.has_changes }}" == "true" ]]; then
68
+ echo "Dependencies updated to version ${{ github.event.inputs.core_version }}"
69
+ if [[ "${{ github.event.inputs.create_pr }}" == "true" ]]; then
70
+ echo "Pull request created"
71
+ else
72
+ echo "Changes committed but no PR created"
73
+ fi
74
+ else
75
+ echo "No changes detected - dependencies might already be at version ${{ github.event.inputs.core_version }}"
76
+ fi
0 commit comments