Skip to content

Commit

Permalink
temp file
Browse files Browse the repository at this point in the history
  • Loading branch information
prateek-kommunicate authored Dec 23, 2024
1 parent 328c681 commit 30b0a41
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Code Lint, Build Checks and UI Tests
run-name: Code Lint and Build Checks PR - ${{ github.event.pull_request.number }}
run-name: Code Lint, Build Checks and UI Tests PR - ${{ github.event.pull_request.number }}

on:
pull_request:
Expand Down Expand Up @@ -179,12 +179,12 @@ jobs:
chmod +x ./gradlew
# Run lint checks in kommunicate module
- name: Lint Kommunicate module
- name: Lint checks for Kommunicate module
run: |
./gradlew kommunicate:lint
# Run lint checks in kommunicate ui module
- name: Lint Kommunicate UI module
- name: Lint checks for Kommunicate UI module
run: |
./gradlew kommunicateui:lint
Expand Down Expand Up @@ -295,15 +295,17 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
});
console.log(`Artifacts: $artifacts`);
const artifact = artifacts.data.artifacts.find(a => a.name === artifactName);
if (artifact) {
core.setOutput('artifact_url', artifact.archive_download_url);
console.log(`Artifact URL: ${artifact.archive_download_url}`);
const downloadUrl = artifact.archive_download_url;
const authenticatedUrl = `${downloadUrl}?access_token=${process.env.GITHUB_TOKEN}`;
core.setOutput('artifact_url', authenticatedUrl);
console.log(`Authenticated Artifact URL: ${authenticatedUrl}`);
} else {
core.setFailed(`Artifact ${artifactName} not found.`);
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Post a comment on the PR with the artifact URL
- name: Post APK URL
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/temp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Code Lint, Build Checks and UI Tests
run-name: Code Lint, Build Checks and UI Tests PR - ${{ github.event.pull_request.number }}

on:
pull_request:
branches:
- development
- master # Run only for pull requests targeting the develop and master branch
types:
- synchronize # Trigger when commits are added to the pull request
- opened # Trigger when a pull request is first opened
- reopened # Trigger when a previously closed pull request is reopened

jobs:
build:
name: "Build Project"
runs-on: ubuntu-latest

steps:
- name: Get Artifact URL
id: get-artifact-url
uses: actions/github-script@v6
with:
script: |
const downloadUrl = "https://api.github.com/repos/Kommunicate-io/Kommunicate-Android-Chat-SDK/actions/artifacts/2355441843"
console.log(${process.env.GITHUB_TOKEN});
const authenticatedUrl = `${downloadUrl}?access_token=${process.env.GITHUB_TOKEN}`;
core.setOutput('artifact_url', authenticatedUrl);
console.log(`Authenticated Artifact URL: ${authenticatedUrl}`);
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 30b0a41

Please sign in to comment.