Skip to content

Commit 876cfd1

Browse files
Refactor GitHub Actions workflow for issue syncing
Updated workflow to sync issues with lib_smsmms and removed SSH command execution.
1 parent bb9a74c commit 876cfd1

1 file changed

Lines changed: 12 additions & 40 deletions

File tree

.github/workflows/main.yml

Lines changed: 12 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,21 @@
1-
name: Run SSH command
2-
1+
name: Sync to lib_smsmms
32
on:
4-
workflow_dispatch:
5-
pull_request:
6-
types:
7-
- closed
83
issues:
94
types: [labeled]
105

116
jobs:
12-
build:
7+
sync_issue:
8+
if: github.event.label.name == 'libsmsmms'
139
runs-on: ubuntu-latest
14-
environment: production
1510
steps:
16-
- name: Run SSH command
17-
uses: appleboy/ssh-action@master
18-
timeout-minutes: 60
11+
- name: Create issue in lib_smsmms_android
12+
uses: actions-ecosystem/action-create-issue@v1
1913
with:
20-
command_timeout: "60m"
21-
host: ${{ secrets.HOST }}
22-
username: ${{ secrets.USERNAME }}
23-
password: ${{ secrets.PASSWORD }}
24-
port: ${{ secrets.PORT }}
25-
script: |
26-
bash -s << 'EOF'
27-
echo "Event: ${{ github.event_name }}"
28-
29-
# Handle merged pull requests
30-
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
31-
if [[ "${{ github.event.pull_request.merged }}" == "true" ]]; then
32-
if [[ "${{ github.event.pull_request.base.ref }}" == "staging" ]]; then
33-
cd /root/digitalocean_ci_cd_app_releases && ./start.sh
34-
elif [[ "${{ github.event.pull_request.base.ref }}" == "master" ]]; then
35-
cd /root/digitalocean_ci_cd_app_releases && ./start.sh cp && ./start.sh build
36-
fi
37-
else
38-
echo "PR closed but not merged. Skipping."
39-
exit 0
40-
fi
41-
fi
14+
github_token: ${{ secrets.SYNC_TOKEN }}
15+
repo: smswithoutborders/lib_smsmms_android
16+
title: ${{ github.event.issue.title }}
17+
body: |
18+
${{ github.event.issue.body }}
4219
43-
# Handle label events
44-
if [[ "${{ github.event_name }}" == "issues" ]]; then
45-
echo "Label event detected. Running issues command."
46-
cd /home/sherlock/issues_migrate/
47-
./run.sh
48-
fi
49-
EOF
20+
---
21+
**Source:** ${{ github.event.issue.html_url }}

0 commit comments

Comments
 (0)