From 2ae54ded0590e61b4ce3944aa20555d3e0f4487b Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 15 Nov 2024 13:02:34 +0100 Subject: [PATCH 1/9] using checkout in action --- action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/action.yml b/action.yml index 35afbdb..e35cd56 100644 --- a/action.yml +++ b/action.yml @@ -13,6 +13,7 @@ inputs: runs: using: 'composite' steps: + - uses: actions/checkout@v4 - name: "Run Diff" run: | NEW=${{ inputs.new }} From 2f12c11342c849351f3024dfd438c3e1af1f3f57 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 15 Nov 2024 13:43:25 +0100 Subject: [PATCH 2/9] trying checkout --- action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/action.yml b/action.yml index e35cd56..e25959f 100644 --- a/action.yml +++ b/action.yml @@ -14,6 +14,9 @@ runs: using: 'composite' steps: - uses: actions/checkout@v4 + with: + repository: "https://github.com/Adyen/adyen-swift-public-api-diff" + ref: "main" - name: "Run Diff" run: | NEW=${{ inputs.new }} From 9719561861160cbfeec733d9058ffc2180ff870a Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 15 Nov 2024 13:45:38 +0100 Subject: [PATCH 3/9] fix repo string --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index e25959f..0e30097 100644 --- a/action.yml +++ b/action.yml @@ -15,7 +15,7 @@ runs: steps: - uses: actions/checkout@v4 with: - repository: "https://github.com/Adyen/adyen-swift-public-api-diff" + repository: "Adyen/adyen-swift-public-api-diff" ref: "main" - name: "Run Diff" run: | From 4a4817f238e019a62b0f2893887457c3da5b4f08 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 15 Nov 2024 13:59:17 +0100 Subject: [PATCH 4/9] Trying to fetch the latest release artifact --- action.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 0e30097..ba877e2 100644 --- a/action.yml +++ b/action.yml @@ -13,19 +13,23 @@ inputs: runs: using: 'composite' steps: - - uses: actions/checkout@v4 - with: - repository: "Adyen/adyen-swift-public-api-diff" - ref: "main" - name: "Run Diff" run: | + git clone https://github.com/Adyen/adyen-swift-public-api-diff ./tmp-diff-checkout + cd ./tmp-diff-checkout + LATEST_VERSION = $(git describe --abbrev=0 --tags) + cd .. + echo $LATEST_VERSION + NEW=${{ inputs.new }} OLD=${{ inputs.old }} PLATFORM=${{ inputs.platform }} PROJECT_FOLDER=$PWD echo $PROJECT_FOLDER - swift run public-api-diff project --new "$NEW" --old "$OLD" --platform "$PLATFORM" --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt" + curl -vLJO -H 'Accept: application/octet-stream' 'https://github.com/Adyen/adyen-swift-public-api-diff/releases/download/$LATEST_VERSION/public-api-diff' + + ./public-api-diff project --new "$NEW" --old "$OLD" --platform "$PLATFORM" --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt" cat "$PROJECT_FOLDER/logs.txt" cat "$PROJECT_FOLDER/api_comparison.md" >> $GITHUB_STEP_SUMMARY From d332b3d83fbcc71c17694ff82ef2697995d2bc78 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 15 Nov 2024 14:02:55 +0100 Subject: [PATCH 5/9] tmp using checkout-action branch --- .github/workflows/detect-api-changes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/detect-api-changes.yml b/.github/workflows/detect-api-changes.yml index c95333a..c882135 100644 --- a/.github/workflows/detect-api-changes.yml +++ b/.github/workflows/detect-api-changes.yml @@ -56,7 +56,7 @@ jobs: noTargetBranch: 'no target branch' - name: 🔍 Detect Changes - uses: Adyen/adyen-swift-public-api-diff@main + uses: Adyen/adyen-swift-public-api-diff@checkout-action id: public_api_diff with: platform: "macOS" From fbb6e7c10da472193458bb6062e7b76a96f91991 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 15 Nov 2024 14:03:28 +0100 Subject: [PATCH 6/9] fixed action.yml --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index ba877e2..18fc41c 100644 --- a/action.yml +++ b/action.yml @@ -17,7 +17,7 @@ runs: run: | git clone https://github.com/Adyen/adyen-swift-public-api-diff ./tmp-diff-checkout cd ./tmp-diff-checkout - LATEST_VERSION = $(git describe --abbrev=0 --tags) + LATEST_VERSION=$(git describe --abbrev=0 --tags) cd .. echo $LATEST_VERSION From f6c771b3be553419c192fb07315ae6ca522e4d31 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 15 Nov 2024 14:19:30 +0100 Subject: [PATCH 7/9] trying to get it run --- action.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index 18fc41c..c9feb9f 100644 --- a/action.yml +++ b/action.yml @@ -15,20 +15,28 @@ runs: steps: - name: "Run Diff" run: | + # Checkout the repository to get the latest tag git clone https://github.com/Adyen/adyen-swift-public-api-diff ./tmp-diff-checkout cd ./tmp-diff-checkout LATEST_VERSION=$(git describe --abbrev=0 --tags) + + # Clean up the tmp directory cd .. - echo $LATEST_VERSION - + rm -rf ./tmp-diff-checkout + NEW=${{ inputs.new }} OLD=${{ inputs.old }} PLATFORM=${{ inputs.platform }} PROJECT_FOLDER=$PWD - echo $PROJECT_FOLDER + # Fetching the latest version of the script + mkdir working_directory + cd ./working_directory curl -vLJO -H 'Accept: application/octet-stream' 'https://github.com/Adyen/adyen-swift-public-api-diff/releases/download/$LATEST_VERSION/public-api-diff' + chmod 755 public-api-diff + xattr -dr com.apple.quarantine public-api-diff + # Running the script ./public-api-diff project --new "$NEW" --old "$OLD" --platform "$PLATFORM" --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt" cat "$PROJECT_FOLDER/logs.txt" From ab41d5b53d988af8785e59521c391d77b9498f73 Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 15 Nov 2024 14:24:52 +0100 Subject: [PATCH 8/9] switching back to swift run --- action.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/action.yml b/action.yml index c9feb9f..f25aa7f 100644 --- a/action.yml +++ b/action.yml @@ -13,31 +13,19 @@ inputs: runs: using: 'composite' steps: + - uses: actions/checkout@v4 + with: + repository: "Adyen/adyen-swift-public-api-diff" + ref: "0.3.0" - name: "Run Diff" run: | - # Checkout the repository to get the latest tag - git clone https://github.com/Adyen/adyen-swift-public-api-diff ./tmp-diff-checkout - cd ./tmp-diff-checkout - LATEST_VERSION=$(git describe --abbrev=0 --tags) - - # Clean up the tmp directory - cd .. - rm -rf ./tmp-diff-checkout - NEW=${{ inputs.new }} OLD=${{ inputs.old }} PLATFORM=${{ inputs.platform }} PROJECT_FOLDER=$PWD + echo $PROJECT_FOLDER - # Fetching the latest version of the script - mkdir working_directory - cd ./working_directory - curl -vLJO -H 'Accept: application/octet-stream' 'https://github.com/Adyen/adyen-swift-public-api-diff/releases/download/$LATEST_VERSION/public-api-diff' - chmod 755 public-api-diff - xattr -dr com.apple.quarantine public-api-diff - - # Running the script - ./public-api-diff project --new "$NEW" --old "$OLD" --platform "$PLATFORM" --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt" + swift run public-api-diff project --new "$NEW" --old "$OLD" --platform "$PLATFORM" --output "$PROJECT_FOLDER/api_comparison.md" --log-output "$PROJECT_FOLDER/logs.txt" cat "$PROJECT_FOLDER/logs.txt" cat "$PROJECT_FOLDER/api_comparison.md" >> $GITHUB_STEP_SUMMARY From ab10c894ac7e674b76df0463c54cf85781cfcbcc Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 15 Nov 2024 14:36:07 +0100 Subject: [PATCH 9/9] changing ref version --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index f25aa7f..fa11279 100644 --- a/action.yml +++ b/action.yml @@ -16,7 +16,7 @@ runs: - uses: actions/checkout@v4 with: repository: "Adyen/adyen-swift-public-api-diff" - ref: "0.3.0" + ref: "0.4.0" - name: "Run Diff" run: | NEW=${{ inputs.new }}