Skip to content

Commit

Permalink
file names in PR body
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharma-xyz committed Jul 5, 2024
1 parent 0634094 commit 4c743f6
Showing 1 changed file with 38 additions and 10 deletions.
48 changes: 38 additions & 10 deletions .github/workflows/gen-kotlin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,18 @@ jobs:
- name: Generate Protos
run: ./gradlew generateProtos

- name: List directory structure after building
run: ls -R

- name: List generated Kotlin files for debugging
run: ls -R lib/build/generated/source/wire/ || echo "Directory not found"
run: |
find lib/build/generated/source/wire/ -type f -name "*.kt" || echo "Directory not found"
- name: List generated Kotlin files
run: |
gen_files=$(find lib/build/generated/source/wire/ -type f -name "*.kt")
if [ -z "$gen_files" ]; then
echo "Directory not found or no files found"
else
echo "gen_files_list<<$gen_files"
fi
- name: Upload generated Kotlin files
uses: actions/upload-artifact@v4
Expand All @@ -45,14 +52,35 @@ jobs:
name: generated-kotlin-files
path: ./generated

- name: Get Unix Timestamp
id: get-timestamp
run: echo ::set-output name=TIMESTAMP::$(date +'%s')

- name: Create Branch
run: |
timestamp=$(date +'%s')
branch_name="branch-${timestamp}"
git checkout -b $branch_name
git push origin $branch_name
echo "::set-output name=BRANCH_NAME::$branch_name"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.TOKEN }}
branch-suffix: timestamp
committer: Github Actions Bot <42103905+github-actions[bot]@users.noreply.github.com>
author: Github Actions Bot <42103905+github-actions[bot]@users.noreply.github.com>
commit-message: "Add generated Kotlin files $(date +'%Y-%m-%dT%H:%M:%S')"
title: "Add generated Kotlin files $(timestamp)"
body: "This PR adds the generated Kotlin files from the https://github.com/ksharma-xyz/Proto-API project."
branch: ${{ steps.create-branch.outputs.BRANCH_NAME }}
committer: Github Actions Bot <41898282+github-actions[bot]@users.noreply.github.com>
author: Github Actions Bot <41898282+github-actions[bot]@users.noreply.github.com>
commit-message: "Add generated Kotlin files ${ { steps.get-timestamp.outputs.TIMESTAMP }}"
title: "Add generated Kotlin files ${ { steps.get-timestamp.outputs.TIMESTAMP }}"
body: |
### Description
Automated PR to add generated Kotlin files from [Proto-API](https://github.com/ksharma-xyz/Proto-API)
### List of files added:
${{ steps.generate-kotlin.outputs.gen_files_list }}
### Config
Configuration of the workflow is located in `.github/workflows/gen-kotlin.yaml`.
base: main

0 comments on commit 4c743f6

Please sign in to comment.