Skip to content

Commit 36b7f27

Browse files
Randy FayOfer Shaal
authored andcommitted
Provide github workflow to automatically sync and update readme to point to drupal.org
1 parent 38eec09 commit 36b7f27

2 files changed

Lines changed: 69 additions & 74 deletions

File tree

.github/workflows/mirror.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# This mirrors daily from an upstream repository.
2+
# These two things must be set:
3+
# UPSTREAM_REPO should be set to something like
4+
# https://git.drupalcode.org/issue/drupalpod-3474581.git
5+
# WORKFLOW_TOKEN is a secret in the "normal" environment containing
6+
# a fine-grained PAT with permissions to read/write content and read/write workflows
7+
8+
name: Mirror from Upstream
9+
defaults:
10+
run:
11+
shell: bash
12+
on:
13+
schedule:
14+
- cron: '0 0 * * *' # Runs daily at midnight UTC
15+
workflow_dispatch: # Allows manual triggering of the workflow
16+
17+
permissions:
18+
contents: write
19+
20+
jobs:
21+
mirror:
22+
runs-on: ubuntu-latest
23+
env:
24+
CLONEDIR: "/tmp/clonedir"
25+
# The environment variables will be in the environment "normal"
26+
environment: "normal"
27+
28+
steps:
29+
- name: Set up Git environment
30+
run: |
31+
git config --global user.name "GitHub Action"
32+
git config --global user.email "action@github.com"
33+
34+
- name: Clone upstream repository
35+
run: |
36+
set -x
37+
set -eu -o pipefail
38+
mkdir -p ${CLONEDIR}
39+
# The variable UPSTREAM_REPO must be set in the repository's
40+
# "normal" environment
41+
git clone --mirror "${{ vars.UPSTREAM_REPO }}" "${{ env.CLONEDIR }}"
42+
43+
- name: Remove existing Git credentials
44+
run: |
45+
git config --global --unset-all http.https://github.com/.extraheader || true
46+
47+
- name: Push to GitHub
48+
env:
49+
# The WORKFLOW_TOKEN is a fine-grained PAT with
50+
# contents: read-write and
51+
# workflow:read/write perm for this repo
52+
WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
53+
REPO: ${{ github.repository }}
54+
55+
run: |
56+
set -x
57+
cd ${{ env.CLONEDIR }}
58+
git remote set-url origin "https://github.com/${REPO}.git"
59+
git config --global user.name "GitHub Action"
60+
git config --global user.email "action@github.com"
61+
git remote set-url origin "https://x-access-token:${WORKFLOW_TOKEN}@github.com/${REPO}.git"
62+
git push --mirror
63+
64+

README.md

Lines changed: 5 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,9 @@
11
# DrupalPod
22

3-
| <h2>:point_right: Start here</h2>1. Download the DrupalPod browser extension<br>[Chrome](https://chrome.google.com/webstore/detail/drupalpod-helper-extensio/pjfjhkcfkhbemnbpkakjhmboacefmjjl?hl=en) or [Firefox](https://addons.mozilla.org/en-US/firefox/addon/drupalpod).<br><br>2. Go to any issue page on Drupal.org<br>(core, module, or theme).<br><br>3. Click on the DrupalPod extension.<br><br>4. (Optional) Choose a patch / issue fork / branch.<br><br><hr>:tada: A full Drupal development environment is being generated for you :tada:<br><br>Please submit [feedback, bug reports and feature requests](https://github.com/shaal/DrupalPod/issues/new/choose) | [![DrupalPod logo](https://user-images.githubusercontent.com/22901/122864786-40253c00-d2f3-11eb-959b-61fb6871e3f4.png)](https://gitpod.io/from-referrer/) |
4-
| - | :- |
3+
## **IF YOU ARE ON GITHUB THIS IS NOT THE REPOSITORY YOU WANT**
4+
## **THE DRUPALPOD REPOSITORY HAS MOVED TO https://drupal.org/project/DrupalPod**
55

6-
<br>
6+
* Please file issues there.
7+
* Please do Merge Requests there.
8+
* This repo is just a mirror.
79

8-
## About the project
9-
10-
This project allows you to work on Drupal contributions with a familiar setup of a "normal" Drupal website.\
11-
No computer is needed because it is all running in the cloud.
12-
13-
* Install additional packages - `ddev composer`
14-
* Run Drush commands - `ddev drush <command>`
15-
* Run tests
16-
* Nightwatch - `ddev nightwatch <arguments>`
17-
* PHPUnit - `ddev phpunit <arguments>`
18-
* IDE in a browser
19-
* VScode (default)
20-
* PHPStorm - run `phpstorm`
21-
22-
<br>
23-
24-
## Project structure
25-
26-
* Every project is cloned into `/repos/<project_name>`
27-
* Required by composer
28-
* Symlinked into a normal Drupal website structure:
29-
* Core directory `/web/core`
30-
* Module directory `/web/modules/contrib/module_name`
31-
* Theme directory `/web/themes/contrib/theme_name`
32-
33-
<br>
34-
35-
## The secret sauce
36-
37-
* [Gitpod](https://www.gitpod.io) - development environment in the cloud
38-
* [DDEV](https://ddev.readthedocs.io/en/stable) - easy setup for PHP projects using Docker
39-
* [DrupalPod](https://chrome.google.com/webstore/detail/drupalpod-helper-extensio/pjfjhkcfkhbemnbpkakjhmboacefmjjl?hl=en
40-
) Browser Extension
41-
* [Drupal Core Development Project](https://github.com/joachim-n/drupal-core-development-project)
42-
43-
<br>
44-
45-
## Pushing code
46-
47-
_\* In order to push code, a **one time** SSH keys setup is required._
48-
49-
From within a Gitpod workspace run:
50-
51-
1. `.gitpod/drupal/ssh/02-setup-private-ssh.sh` \
52-
Follow the instructions on the screen.
53-
54-
1. `.gitpod/drupal/ssh/04-confirm-ssh-setup.sh` \
55-
If SSH keys are valid, it stores your private SSH key as an environment variable in Gitpod.
56-
57-
<br>
58-
59-
## Notes
60-
61-
* Manual SSH setup is a temporary requirement until the Drupal's self-hosted Gitlab gets integrated with Gitpod.
62-
63-
[WIP - making a friendlier interactive dialog](https://github.com/shaal/DrupalPod/issues/4).
64-
65-
* If you prefer working locally - you can clone this repo to your computer.\
66-
The only 2 requirements are [Docker](https://ddev.readthedocs.io/en/stable/users/docker_installation/) and [DDEV](https://ddev.readthedocs.io/en/stable/#installation).
67-
68-
<br>
69-
70-
## Thank you
71-
72-
* [Randy Fay](https://github.com/rfay)
73-
* [Joe Still](https://github.com/bioshazard)
74-
* [Joachim](https://github.com/joachim-n)
75-
76-
---
77-
78-
![DrupalPod-logo](https://user-images.githubusercontent.com/22901/122864786-40253c00-d2f3-11eb-959b-61fb6871e3f4.png)

0 commit comments

Comments
 (0)