Skip to content

Commit

Permalink
Add auto merge method for dependabot pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Nlkomaru committed Sep 17, 2024
1 parent 53fd4d9 commit 1daaf95
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Build with Gradle
run: ./gradlew build -x test
run: ./gradlew clean build -x test
- name: Set final commit status
uses: myrotvorets/set-commit-status-action@master
if: always()
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/dependabot_auto_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dependabot auto-merge
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1.1.1
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
9 changes: 0 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'gradle'

- name: Change wrapper permissions
run: chmod +x ./gradlew

- uses: release-drafter/release-drafter@v6
id: release-drafter
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ jobs:
- name: Change wrapper permissions
run: chmod +x ./gradlew

- name: Set plugin version
run: sed -i "s/versionPlaceholder/${{ github.event.release.tag_name }}/g" ./build.gradle.kts

- name: Build with Gradle
run: ./gradlew build -x test
run: ./gradlew clean build -x test

- name: Rename jar
run: mv ./build/libs/PluginTemplate-1.0-SNAPSHOT-all.jar ./build/libs/PluginTemplate_${{ github.event.release.tag_name }}.jar

- name: Set plugin version
run: sed -i "s/versionPlaceholder/${{ github.event.release.tag_name }}/g" ./build.gradle.kts
run: mv ./build/libs/PluginTemplate-1.0-SNAPSHOT-all.jar ./build/libs/PluginTemplate_${{ github.event.release.tag_name }}.jar #TODO Change PluginTemplate to your plugin name

- name: Upload release
uses: softprops/action-gh-release@v2
with:
files: ./build/libs/PluginTemplate_${{ github.event.release.tag_name }}.jar
files: ./build/libs/PluginTemplate_${{ github.event.release.tag_name }}.jar #TODO Change PluginTemplate to your plugin name
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

group = "dev.nikomaru" //TODO need to change
version = "1.0-SNAPSHOT"
version = "1.0-SNAPSHOT" //Don't change

fun captureVersion(dependency: Dependency): String {
return dependency.version ?: throw IllegalArgumentException("Version not found for $dependency")
Expand Down Expand Up @@ -75,7 +75,7 @@ sourceSets.main {
resourceFactory {
bukkitPluginYaml {
name = rootProject.name
version = "versionPlaceholder"
version = "versionPlaceholder" //Don't change
website = "https://github.com/Nlkomaru/PluginTemplate" //TODO need to change
main = "$group.template.Template" //TODO need to change
apiVersion = "1.20"
Expand Down

0 comments on commit 1daaf95

Please sign in to comment.